PHP fopen warning

$file = @fopen("http://ajax.htm","rb");

      

I am getting this error when using fopen

Warning: fopen(xyz.htm): failed to open stream: HTTP request failed! 
in /home/user/public_html/aaa/ttt.php on line 8

      

what could be the reason for this?

0


a source to share


3 answers


I'm going to go to a huge limb here and assume the problem is with the url, http: //ajax.htm '.



+7


a source


from the documentation :

If PHP decides that it filename

is a registered protocol and that protocol is registered as a network URL, PHP checks that allow_url_fopen

. If disabled, PHP will issue a warning and fopen will fail.



edit : is ajax.htm

not a valid URL.

+1


a source


$file = @fopen("ajax.htm","rb");

      

there is your problem i think

http://nl3.php.net/function.fopen

+1


a source







All Articles