hey...
I have a postgreSQL database which contains URL's to HTML documents. I want to output the contents of this document on a particular page on my site. so far i have tried 'file_get_contents', 'include' and 'fopen' but dont seem to be getting anywhere. The code i am using is
<?php
$sql="select * from jfs where issue = (select max(issue) from jfs) and format = 'html'";// selects the latest issue
$result_set = pg_Exec ($conn, $sql);
$rows = pg_NumRows($result_set);
if ((!$result_set) || ($rows < 1)) {
echo "<H1>ERROR - no rows returned</H1><P>";
exit; //exit the script
}
for ($j=0; $j < $rows; $j++)
{
$issue = pg_result($result_set, $j, "issue");
$page = pg_result($result_set, $j, "page");
$author = pg_result($result_set, $j, "author");
$title = pg_result($result_set, $j, "title");
$format = pg_result($result_set, $j, "format");
$url = pg_result($result_set, $j, "url");
//$url="http://google.co.uk/";
//$home=readfile($url);
include ("$url");
//echo $home;
}
?>
<?php
pg_FreeResult($result_set);
pg_Close($conn);
?>
i know that my query my working as i am able to echo the url but cannot display the contents of the file
any help would be greatley appreciated
el nino