Hello, I try to use the following code:
<!-- GOOGLE WORLD NEWS -->
<?php
$resultCount = '5';
$newsPage = 'http://news.google.com/news?hl=en&q=Deaf+deaf';
//$newsPage = "http://news.google.com/news/gnworldleftnav.html";
$open = fopen($newsPage, "r");
echo $open;
$read = fread($open, 900000);
fclose($open);
preg_match_all("|<a class=y href=\"(.*)\">(.*)</a><BR>\n<font size=-1>\n<b><font color=#6f6f6f>(.*) -</font> (.*)</b>\n<BR>|U",$read,$result);
echo "<table border=0 width=100% cellspacing=0 cellpadding=1>";
for ($i = 0; $i <= $resultCount; $i++) { // loop through all the news results
?>
<!-- START EDIT -->
<TR>
<TD><font size=-1 face='times new roman'><B>•</B></TD>
<TD><font size=-1 face='times new roman'><a href="<?=$result[1][$i]?>" target="_blank"><?=$result[2][$i]?></a> - <?=$result[3][$i]?> (<?=$result[4][$i]?>)</TD>
</TR>
<!-- END EDIT -->
<?
}
?>
</TABLE>
<!-- END GOOGLE WORLD NEWS -->
and I get this error:
Warning: fopen("http://news.google.com/news/?hl=en&q=Deaf+deaf","r") - No error in C:\apache\htdocs\google.php on line 23
(line is different as I took out the comments at the top of the script)
Now uncomment the other $newsPage and comment the current one and it will work fine.
I know that the Regex needs to be different for the different page, but at the moment that doesn't matter as it won't even open the page! :mad:
Anyone got any ideas? 😕
Edit: And incase anyone needs to know, it's been tried on PHP 4.0.2 and 4.0.5