View Full Version : No error in local host but error in server

12-08-2010, 10:27 AM
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

header("Content-Type: text/xml");
$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>
$ans = $radio->getEradioSongPlaylist($weekNum,$dayNum,$hourNum,$minNum);

foreach($ans as $song)
<location>eradio/songs/<?php echo $song; ?>.mp3</location>
<title><?php echo $song; ?></title>

Whats wrong?

12-08-2010, 11:39 AM
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 '';
<?xml version="1.0" encoding="UTF-8"?>

12-08-2010, 11:45 AM
awesome! it worked :D