Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post

    Exclamation No error in local host but error in server

    Hi there below is the code i used to generate a playlist in xml format
    I get no error in my localhost and i get the proper output but when i upload it to the server i get the followin error if i run
    Parse error: syntax error, unexpected T_STRING in ...../playlist.php on line 7
    PHP Code:
    <?php
    header
    ("Content-Type: text/xml");
    include_once(
    "../secure.php");
    $radio_conn MANAGER::GET_CONNECTION($ehost_name,$user,$password,$database);
    $radio=new MANAGER($radio_conn);
    ?>
    <?xml version
    ="1.0" encoding="UTF-8"?>
    <playlist version="1" xmlns = "http://xspf.org/ns/0/">
      <title>Bedupako E radio</title>
      <trackList>
      <?php
    $ans 
    $radio->getEradioSongPlaylist($weekNum,$dayNum,$hourNum,$minNum);

      foreach(
    $ans as $song)
      {
          
    ?>
        <track>
          <location>eradio/songs/<?php echo $song?>.mp3</location>
          <title><?php echo $song?></title>
        </track>
        <?php
      
    }
      
    ?>
      </trackList>
    </playlist>
    Whats wrong?
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs

  • #2
    New Coder
    Join Date
    Dec 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your server is using shortcodes and see <? and ?> as start and end for php. Since it is hard to change settings for server, i reccoment you to echo the following line directly from php with echo '';
    PHP Code:
    <?xml version="1.0" encoding="UTF-8"?>

  • #3
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post
    awesome! it worked
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

    Albert Einstein
    -----------------------------------------------------
    My Blog songs


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •