Jump to content

Fsockopen $errno


superpimp

Recommended Posts

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 sekunden

if(@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!
Link to comment
Share on other sites

[!--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 sekunden

if(@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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.