What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » is the server online using php

Pages: (2): « First [ 1 ] 2 » Last »
is the server online using php
Author: Message:
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. is the server online using php
well i have a shoutcast server running on my pc it's all working with port fowarding and stuff  but i want to use some php to test if the port is open or closed(running or shutdown)
using https://www.grc.com i have seen that their script does just what i want but i'm looking for some php to do something similar,
i found this
code:
<?
$ip = "http://247.212.233.220"; // IP Here
$port = 8000; // Port Here
if(fsockopen($ip, $port, $errno, $errstr, '10'))
echo "The  server is <font color='green'>Online</font>!";
else
echo "The  server is <font color='red'>Offline</font>!";
?>

but even if the port is open and https://www.grc.com says it's open the php script says it closed can some one help?

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














06-05-2008 08:53 AM
Profile E-Mail PM Find Quote Report
Menthix
forum admin
*******

Avatar

Posts: 5537
Reputation: 102
40 / Male / Flag
Joined: Mar 2002
RE: is the server online using php
What does $errstr say?
Finish the problem
Menthix.net | Contact Me
06-05-2008 09:06 AM
Profile E-Mail PM Web Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: is the server online using php
i don't know how it works here is the link though and i'll put the server up until 9:00pm AEST
http://home.exetel.com.au/goldenleads/is_server_running.php

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














06-05-2008 09:26 AM
Profile E-Mail PM Find Quote Report
Menthix
forum admin
*******

Avatar

Posts: 5537
Reputation: 102
40 / Male / Flag
Joined: Mar 2002
RE: is the server online using php
Try this:
code:
<?
$ip = "http://247.212.233.220"; // IP Here
$port = 8000; // Port Here
if(fsockopen($ip, $port, $errno, $errstr, '10')) {
   echo "The  server is <font color='green'>Online</font>!";
} else {
   echo "The  server is <font color='red'>Offline</font>!<br/>";
   echo "Returned error: ".$errstr." (code ".$errno.")";
}
?>

This post was edited on 06-05-2008 at 09:33 AM by Menthix.
Finish the problem
Menthix.net | Contact Me
06-05-2008 09:31 AM
Profile E-Mail PM Web Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: is the server online using php
it doesn't seem to work,:(
one thing i may need to state is that my shoutcast server isn't hosting my php that's hosted somewhere else,
i think you gathered that MenthiX but just to be sure, well
how it when both times it returned the server was offline
with the http:// in front of the ip address it returned permission denied on the next line, with the http:// removed it returned Invalid argument

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














06-05-2008 09:48 AM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: is the server online using php
Well for a start the IP shouldn't contain the "http://" bit at the start :P

Also, timeout shouldn't be in quotes, it's not a string.

This post was edited on 06-05-2008 at 09:51 AM by Eljay.
06-05-2008 09:50 AM
Profile PM Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: is the server online using php
didn't fix anything

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














06-05-2008 10:15 AM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: is the server online using php
Try this http://www.phptoys.com/e107_plugins/content/content.php?content.41 ?
06-05-2008 10:28 AM
Profile E-Mail PM Web Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: is the server online using php
quote:
Originally posted by Jarrod
didn't fix anything
are you sure you have:
code:
<?
$ip = "247.212.233.220"; // IP Here
$port = 8000; // Port Here
if(fsockopen($ip, $port, $errno, $errstr, 10)) {
   echo "The  server is <font color='green'>Online</font>!";
} else {
   echo "The  server is <font color='red'>Offline</font>!<br/>";
   echo "Returned error: ".$errstr." (code ".$errno.")";
}
?>
because i just tested it on my localhost and it says that its online =\
06-05-2008 10:35 AM
Profile PM Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. RE: is the server online using php
NF
The server is Offline!
Returned error: Invalid argument (code 22)

i'm looking at felu's now but me being less knowledgeable than every1 elses it might take a while

This post was edited on 06-05-2008 at 12:02 PM by Jarrod.

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














06-05-2008 11:50 AM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On