hi, I wanted to display news using javascript from a different hml file.
Here is the code i have used
inews.php file
<?php
require_once("C:\www\Apache\htdocs\mainfile.php");
global $dbi;
$perpage=10;
$result=mysql_query("Select newsid,headline from inews ORDER BY newsid DESC limit $perpage",$dbi);
while(list($newsid,$headline)=mysql_fetch_row($result)) {
$news="<strong><big>.</big></strong> <a href=\"http://localhost/inews.php?name=inews&file=index&action=click&newsid=$newsid\">$headline</a> <br>";
echo "<script language=\"JavaScript\">\n";
echo "document.write('$news')";
echo "</script>";
}
?>
And code to display news in any html file are
<script src="http://localhost/inews.php"></script>
It's not working .. What did i missed ?

