I try to connect to a site via fsockopen function and get data calling a cgi on remote server using a script like this following. The response is a large amount of data up to 500Kb. But every 5000 characters approximately I get arbitrary strings like numbers "1400" and "800" and others like "7be" etc. I don't know what to do to avoid this trouble. Please if someone knows, let help me. Thanks.
PHP SCRIPT -------------------- $fp = fsockopen ("ns.ana.gr", 80); fputs ($fp, "GET http://www.xxx.com/cgibin/xxx.exeservice=SPE&format=TXT&time=3&day=11/03/200 3 HTTP/1.1\r\nHost: www.xxx.com\r\nAuthorization: Basic xxxxxxxxxxxxxxxxx==\r\n\r\n"); while (!feof($fp)) { $line = fgetc ($fp); echo $line; } fclose ($fp); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php