superpimp Posted April 22, 2006 Share Posted April 22, 2006 Is there a page where I can get an explation for fosockopen's $errno? I searched the php.net site and google but didnt found a thing.When I echo $errstr, it's blank.[code]<?php$host = "www.efzefrzefgoogle.com"; //zu prüfender host$timeout = 10; //timeout in sekundenif(@fsockopen($host, "80",$errno,$errstr,$timeout)) //prüfen, ob der host erreichbar ist, das @ unterdrückt fehlerausgabe{echo "<p>Online!</p>";}else{echo "<p>Offline!</p>".$errno;}?>[/code]thx! Quote Link to comment Share on other sites More sharing options...
KrisNz Posted April 23, 2006 Share Posted April 23, 2006 [!--quoteo(post=367491:date=Apr 23 2006, 03:23 AM:name=superpimp)--][div class=\'quotetop\']QUOTE(superpimp @ Apr 23 2006, 03:23 AM) [snapback]367491[/snapback][/div][div class=\'quotemain\'][!--quotec--]Is there a page where I can get an explation for fosockopen's $errno? I searched the php.net site and google but didnt found a thing.When I echo $errstr, it's blank.[code]<?php$host = "www.efzefrzefgoogle.com"; //zu prüfender host$timeout = 10; //timeout in sekundenif(@fsockopen($host, "80",$errno,$errstr,$timeout)) //prüfen, ob der host erreichbar ist, das @ unterdrückt fehlerausgabe{echo "<p>Online!</p>";}else{echo "<p>Offline!</p>".$errno;}?>[/code]thx![/quote]In your code you're supressing error messages, Im not sure if that effects the error string being modified though. Also you aren't going to be able to do anything with your connection without getting the resource returned by fsockopen.Try following the example code on the php.net page for fsockopen. php.net/fsockopen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.