Possible problem with ReceiveHTTPFile()

Everything else that doesn't fall into one of the other PB categories.
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Possible problem with ReceiveHTTPFile()

Post by doctorized »

I have a php file with only these lines inside:

Code: Select all

<?php
if(isset($_SERVER["HTTP_X_FORWARDED_FOR"])){
  echo "PROXY";
  $var=$_SERVER["HTTP_X_FORWARDED_FOR"];
}else{
  $var=$_SERVER["REMOTE_ADDR"];
}
$hostname = gethostbyaddr($var);
echo "[[$var]][[$hostname]]";
?>
And I have this code in PB:

Code: Select all

InitNetwork()

For i=1 To 20
	ReceiveHTTPFile("http://............./host.php", "c:\test\host_" + Str(i) +".txt")
Next
In 6 files there is only one line (as it sould be) containing the data needed but the rest 14 files contain also the header:

Code: Select all

Connection: close
X-Powered-By: PHP/5.2.6
Content-type: text/html
Date: Sat, 01 Feb 2014 11:01:14 GMT
Server: lighttpd/1.4.20
Content-Length: 54 
Is there any way to be ReceiveHTTPFile's fault?
True29
User
User
Posts: 64
Joined: Sun Feb 03, 2013 1:50 am

Re: Possible problem with ReceiveHTTPFile()

Post by True29 »

Use a Network include wich handels network errors.
Post Reply