Forum Moderators: coopster

Message Too Old, No Replies

PHP and Javascript.Frustating

         

BlackRaven

10:41 am on Dec 23, 2005 (gmt 0)

10+ Year Member



hi, i am having problems in creating a javascript version of my rss feed. In particular i am having problems with the document.write....

$fj = fopen ("index.js", "w");
while($row = mysql_fetch_array($result))
{
$title=$row[1];
$title=htmlspecialchars($title, ENT_QUOTES);

$id=$row[0];
$stuff="document.write('<http://www.example.com/index.php?post=$id>$title<\/a>')";
fwrite ($fj, "$stuff");
}
fclose ($fj);

whoisgregg

5:21 pm on Dec 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure what problem you are having, but I guess that the link doesn't work? Try this:

$stuff="document.write('[red]<a href=\"[/red]http://www.example.com/index.php?post=$id[red]\"[/red]>$title<\/a>')";