PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function search ($searchsite="test", $query="test")
{
$encodedquery = urlencode($query);
$site="http://www.google.com/search?q=test";
$results = file("$site"); //this is line 8 btw
foreach($results as $line)
{
echo $line;
}
}
search();
?>
In the above code I'm only tring to verify that the website with the google results will be retrieved. None of the variable arguments are being used.
If I only put "http://www.google.com/" it works fine. I've tried retrieving multiple sites and they all work fine. I only get the error when pages are 404. I'm just lost as to why "http://wwww.google.com/search?q=test" gives this warning when I can browse to it easily.
Thanks in advance for any help.
Last edited by senin on Fri Jan 02, 2004 5:20 pm, edited 1 time in total.
I'm sorry about the dot, I'll edit it out immediately. my script doesn't contain it.
I'm still unable to retrieve the website. would you mind posting what version of PHP you are using and anything else you think could be causing the difference in our results.