Jump to content
xisto Community
Sign in to follow this  
ChopSuey

Open Port Check

Recommended Posts

I have a server for a game on my computer, and want to put a server status code on my website. I was wondering if something like this would work:



<?$ip = "IP"; // IP Here$port = PORT; // Port Hereif(fsockopen($ip, $port, $errno, $errstr, '10'))echo "The game server is <font color='green'>Online</font>!";elseecho "The game server is <font color='red'>Offline</font>!";?>

Share this post


Link to post
Share on other sites

I tried it, and it doesnt seem to connect. I get a php warningWarning: fsockopen(): unable to connect to ar.servegame.com:50000 in /home/chopsuey/public_html/test.php on line 14

Share this post


Link to post
Share on other sites

dear ChopSuey i think you must select port at localhost ( your hosting) for any connection you need 2 open port and 2 ip , at this code you select remote port (your pc) but you dont select local port (default = 80 ) you need to active localport !
thanks


<?$ip = "IP"; // IP Here$port = PORT; // Port Hereif(fsockopen($ip, $port, $errno, $errstr, '10'))echo "The game server is <font color='green'>Online</font>!";elseecho "The game server is <font color='red'>Offline</font>!";?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.