SoundreameR Posted January 3, 2007 Share Posted January 3, 2007 Hello everyone, nice forum you have here... I have a strange problem going on on my home and work linux platform. And here it is... I made a little script, which tests the server status on port 80. You all know it's just a couple of lines, and it's impossible to be mistaken... Soooo... the funny thing is that, when I execute it via web browser and requiest the status of hdghfagdhfad.bg for example (as you can see, it does not exist) it gives me positive result, which is sooooo wrong... when I execute it from shell (php asd.php) the result is correct - Server Down (can't connect to port 80 on such host). Why is this happening? I was hesitating about the category of this quistion, Apache problems or PHP problems... but yet.. it's a problem all right... ;) Link to comment https://forums.phpfreaks.com/topic/32631-fsockopen-problem/ Share on other sites More sharing options...
SoundreameR Posted January 3, 2007 Author Share Posted January 3, 2007 Some one? Any Ideas ??? Link to comment https://forums.phpfreaks.com/topic/32631-fsockopen-problem/#findComment-152299 Share on other sites More sharing options...
corbin Posted January 3, 2007 Share Posted January 3, 2007 Can we see the code? Link to comment https://forums.phpfreaks.com/topic/32631-fsockopen-problem/#findComment-152301 Share on other sites More sharing options...
SoundreameR Posted January 3, 2007 Author Share Posted January 3, 2007 Sure... [code]<?$addr = $_GET['addr'];$port = "80";$fp = fsockopen($addr, $port, $errno, $errstr, 30);if (!$fp) {echo "$addr - OFFLINE - $errstr ($errno)";}else {echo "$addr - ONLINE";fclose($fp);}?>[/code] Link to comment https://forums.phpfreaks.com/topic/32631-fsockopen-problem/#findComment-152350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.