Hey guy I installed a script on my server to run and I am getting the following errors. Do i need to configure my php.ini to fix these errors? The script works fine on another server I use.
<b>Warning</b>: feof(): supplied argument is not a valid File-Handle resource in <b>/home/admin/3.php</b> on line <b>108</b><br />
<br />
<b>Warning</b>: fread(): supplied argument is not a valid File-Handle resource in <b>/home/admin/3.php</b> on line <b>109</b><br />
<br />
<b>Warning</b>: feof(): supplied argument is not a valid File-Handle resource in <b>/home/admin/3.php</b> on line <b>110</b><br />
Any help is appreciated.
Function errors please help!
Moderator: General Moderators
Here is the code sniplet
#Get the first 1000 results
echo "Search term: " . urldecode($searchterm) . "\nGetting up to 1000 results. This can take several minutes.\n";
for($start = 0; $start <= 900; $start+=100){
if($start > 0)
$extra = "&start=$start";
$sock = fsockopen("www.google.com", 80);
fputs($sock, "GET /search?q=$searchterm&num=100&sa=N$extra$filter HTTP/1.1\r\nHost: http://www.google.com\r\nConnection: Close\r\n$cookie\r\n\r\n");
while(!feof($sock)){
$result .= fread($sock, 10240);
if(feof($sock))
break;
}
sleep(10);
}
echo "Search term: " . urldecode($searchterm) . "\nGetting up to 1000 results. This can take several minutes.\n";
for($start = 0; $start <= 900; $start+=100){
if($start > 0)
$extra = "&start=$start";
$sock = fsockopen("www.google.com", 80);
fputs($sock, "GET /search?q=$searchterm&num=100&sa=N$extra$filter HTTP/1.1\r\nHost: http://www.google.com\r\nConnection: Close\r\n$cookie\r\n\r\n");
while(!feof($sock)){
$result .= fread($sock, 10240);
if(feof($sock))
break;
}
sleep(10);
}