Hi Ive got a problem with the fsockopen function. I want to simulate things like Browser-Version (user_agent) to another php-Script and read its parsed ScourceCode. Everything I read about that used fsockopen() as the main function to access the file. So I tried this:
$fp = fsockopen ("http://www.homepage.de", 80); Also with /index.html in the end and with many different URLs. This way I always get the following two errors: Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: gethostbyname failed in D:\Programme\Apache2\htdocs\eigene\test\read.php on line 3 Warning: fsockopen() [function.fsockopen]: unable to connect to http://www.homepage.de:80 in D:\Programme\Apache2\htdocs\eigene\test\read.php on line 3 $fp does not exist! Ive already been told to leave out the http://. But in that case i got: Fatal error: Maximum execution time of 30 seconds exceeded in D:\Programme\Apache2\htdocs\eigene\test\read.php on line 12 Which makes me wondering, because line 12 is the end of the script and not the one with the fsockopen function... My first thought was that I get timeouted, because i dont have any further issues for the opened coonnection but the whole script is: <?php $fp = fsockopen ("http://www.homepage.de", 80); if(!$fp) { echo "\$fp does not exist!"; } else { fgets($fp, 1024); } ?> Now I do have an fgets-statement to recieve sth from the server. And still he gets timeouted. So why does this happen?! And what can I do against it?! OS is: Win 98SE PHP: 4.3.0 Apache: 2.0.43 allow_url_fopen in the php.ini is activated... Thx for help