Error de feof() y fread()
(Nivel 1 - 2 posts) |
Hola gente, espero que alguien me pueda ayudar ya que busque por distintos lugares la solucion y no puedo dar con ella.
El tema es el siguiente, estoy usando una search engine, configure todos los permisos, y la base de datos. Ahora cuando quiero utilizarla para buscar algo en la Web me da el siguiente error Warning: feof(): supplied argument is not a valid stream resource in /home/guiajobs/public_html/search/includes/incRoutines.php on line 20 Warning: fread(): supplied argument is not a valid stream resource in /home/guiajobs/public_html/search/includes/incRoutines.php on line 22 Y se repite asi casi indefinidamente, el modulo que causa el aparente problema es el siguiente: function GetURL($Url, $MaxSize = 2000000) { // request the url $fp = @fopen($Url, 'rb'); $result = ''; while (!feof($fp)) //esta es la linea 20 // throw the data into a our result $result .= fread($fp, $MaxSize); //esta es la linea 22 // close our connection to remote web server fclose($fp); // if there was an error $result will not be set // change it to an empty string if (!isset($result)) { $result = ''; } else { // remove any extra chars at the beginning $temptext = $result; $startxml = strpos($temptext,"xml")+1; if ($startxml > 3) { $xtratext = $startxml - 3; } else { $xtratext = 0; } $result = substr($temptext,$xtratext); } // return the results return $result; } No puedo econtrar el error. Por favor si alguien me puede ayudar les estare eternamente agradecido... |
