...

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



adarshakb
12-08-2010, 09: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


<?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?

baseter
12-08-2010, 10: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"?>

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum