Howdy...
I have a script that works locally, but not on the server...
I think it has to do with the 'allow_url_fopen' setting being set to '0' in the server... So, I have used ini_set("allow_url_fopen", 1); to bypass it, but with no joy...
Can sombody tell me why I am not able to get this code working on the server when I have no problem running it on my localhost???
Thank you... 😉
<?
// getSite.php
ini_set("allow_url_fopen", 1);
include("Snoopy.class.inc");
$FileName = "./getSite.txt";
$FilePointer = fopen($FileName, "a+");
$date = date("m/d/y H:i:s A T");
$output = "----------\n" . $date . "\n----------\n";
$contents = "";
$snoopy = new Snoopy;
$serverURL = "http://search.yahoo.com/search?";
$searchString = "p=asdfghjklzxcvbnmqwertyuiop&ei=UTF-8";
$fp = fopen($serverURL . $searchString, "r");
while (!feof($fp))
{
$contents .= fread($fp, 1024);
}
$snoopy->fetch($serverURL . $searchString);
echo($snoopy->results);
fwrite ($FilePointer, $snoopy->results);
fclose ($FilePointer);
fclose ($fp);
?>