Hey guys, I am am new to php and mySQL stuff and am trying my hardest to understand what is going on with my script.
Can someone please explain to me what
“Warning: Supplied argument is not a valid File-Handle resource” Means?
I know this has to be something specific but I’ve searched forever on google and forums and not found any info.
My script goes to a feed file and apears to read its contents but I dont know what the “10000” is for
here is my examples:
problem code-
Line 02: $url = "/var/www/sites/mysite.com/forums/src/feed.php";
Line 54: $responsehandle = fopen($url,"r");
Line 56: $botresponse = fread($responsehandle,10000);
Line 58: fclose($responsehandle);
This is the Feed file it opens:
[code]
<?php if (isset($HTTP_GET_VARS["post"]) AND isset($HTTP_GET_VARS["id"]) AND ereg("^[0-9]+$",$HTTP_GET_VARS["id"]) ) { include "respond.php"; $numselects=0; $botresponse=reply($HTTP_GET_VARS['post'],$HTTP_GET_VARS["id"],1); echo $botresponse->response; exit; } ?>[/code]When this script is executed, it returns:
Warning: fopen(“http://cgi.mysite.com/forums/feed.php?id=3&post=”, “r”) - Success in /var/www/sites/mysite.com/forums/sources/invbot.php on line 54
Warning: Supplied argument is not a valid File-Handle resource in /var/www/sites/mysite.com/forums/sources/invbot.php on line 56
Warning: Supplied argument is not a valid File-Handle resource in /var/www/sites/mysite.com/forums/sources/invbot.php on line 58
I think this means that it successfully opened the file but the argument on line 56 (the “10000”) is causing it problems or maybe the “$numselects=0” in my feed file but I am no expert at this.
Does anyone know anyone who can explain what is happening here?
Thank you in advance for any help!