tony007
May 17th, 2006, 11:28 AM
Hi all. I am using the following script and it writes the song url incorectly .It writes like this :
http://localhost/song="3040"http://localhost/song="3041"
I want it to write each song url in one line and no " " around the songid. I be happy if some one help me fix this error.Thanks
expected output:
http://localhost/song=3040
http://localhost/song=3041
$result = mysql_query($query);
//$textfile = time() . ".txt";
$textfile = time() . $_SERVER['REMOTE_ADDR'] . ".txt";
$handle = fopen ($textfile,"w+");
//fwrite($handle,"<player showDisplay=\"yes\" showPlaylist=\"yes\" autoStart=\"yes\">");
while($row = mysql_fetch_assoc($result))
{
//echo "<br>path : {$row['filename']} <br>" .
// "title :{$row['title']} <br>";
$string = "http://localhost/song=\"{$row['songid']}\"";
fwrite($handle,$string);
}
//fwrite($handle,"</player>");
fclose ($handle);
http://localhost/song="3040"http://localhost/song="3041"
I want it to write each song url in one line and no " " around the songid. I be happy if some one help me fix this error.Thanks
expected output:
http://localhost/song=3040
http://localhost/song=3041
$result = mysql_query($query);
//$textfile = time() . ".txt";
$textfile = time() . $_SERVER['REMOTE_ADDR'] . ".txt";
$handle = fopen ($textfile,"w+");
//fwrite($handle,"<player showDisplay=\"yes\" showPlaylist=\"yes\" autoStart=\"yes\">");
while($row = mysql_fetch_assoc($result))
{
//echo "<br>path : {$row['filename']} <br>" .
// "title :{$row['title']} <br>";
$string = "http://localhost/song=\"{$row['songid']}\"";
fwrite($handle,$string);
}
//fwrite($handle,"</player>");
fclose ($handle);