Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Open Port Check
ChopSuey
post Jul 25 2006, 03:36 AM
Post #1


Newbie [Level 2]
**

Group: Members
Posts: 39
Joined: 24-July 06
Member No.: 27,211



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:



CODE
<?
$ip = "IP"; // IP Here
$port = PORT; // Port Here
if(fsockopen($ip, $port, $errno, $errstr, '10'))
echo "The game server is <font color='green'>Online</font>!";
else
echo "The game server is <font color='red'>Offline</font>!";
?>
Go to the top of the page
 
+Quote Post
electron
post Jul 26 2006, 03:03 AM
Post #2


Premium Member
********

Group: Members
Posts: 162
Joined: 10-May 06
Member No.: 23,375



But which post will you try to connect to.
Also will the server allow you to do so.
Go to the top of the page
 
+Quote Post
ChopSuey
post Jul 26 2006, 08:24 PM
Post #3


Newbie [Level 2]
**

Group: Members
Posts: 39
Joined: 24-July 06
Member No.: 27,211



My game server will allow, but will the host? XD

Port: 50000
Go to the top of the page
 
+Quote Post
uiop
post Jul 26 2006, 09:01 PM
Post #4


Premium Member
********

Group: Members
Posts: 192
Joined: 20-December 05
Member No.: 15,962



I belive that would work, why don't you try smile.gif?
Go to the top of the page
 
+Quote Post
ChopSuey
post Jul 26 2006, 09:46 PM
Post #5


Newbie [Level 2]
**

Group: Members
Posts: 39
Joined: 24-July 06
Member No.: 27,211



I tried it, and it doesnt seem to connect. I get a php warning

Warning: fsockopen(): unable to connect to ar.servegame.com:50000 in /home/chopsuey/public_html/test.php on line 14

Go to the top of the page
 
+Quote Post
farsiscript
post Jul 28 2006, 04:58 PM
Post #6


Super Member
*********

Group: Members
Posts: 357
Joined: 8-April 06
Member No.: 21,487



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


CODE
<?
$ip = "IP"; // IP Here
$port = PORT; // Port Here
if(fsockopen($ip, $port, $errno, $errstr, '10'))
echo "The game server is <font color='green'>Online</font>!";
else
echo "The game server is <font color='red'>Offline</font>!";
?>
Go to the top of the page
 
+Quote Post
beeseven
post Jul 28 2006, 06:35 PM
Post #7


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



If your server has a router you may need to forward port 50000.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Open Office Vs Microsoft(46)
  2. The Best And Free Website/html Editors + Text Editors(48)
  3. [help] Java Script: Window.open(10)
  4. Open Source Web Design(52)
  5. Girls: What "not" To Say To Guys!(40)
  6. How To Open A .daa File(39)
  7. Check Referrer To Prevent Linking Yours From Other Sites(8)
  8. Informix To Sql Server (or How To Open .unl Files)(2)
  9. Skype / Xampp Port Conflict(5)
  10. 2nd Method Of Disabling Safe Mode On Winxp(2)
  11. A Port Scanner(9)
  12. Check This Totally Css Site Out(6)
  13. Data Structures -- String -- Palindrome(5)
  14. Open Any Unknown File Type With Notepad(1)
  15. Motorola Rizr Z3(2)
  1. Cannot Open Display - Error(2)
  2. Free Icon Sets For Open Source Projects(0)
  3. Harddrive "open With..." Problem(1)
  4. How To Open Multiple Tabs?(6)
  5. Open Program Copyrights For Third World Nations(7)
  6. Price Check(1)
  7. How To Open Control Panel In Just My Regular Browser(2)
  8. [idea] A New Open Source Racing Game(1)
  9. Open Air Fitness Or Training In The Gym?(2)
  10. The Nokia Morph (cellphone Uses Nanotechnology)(0)
  11. Open Discussion... What The-?(24)
  12. Cpanel Down(5)
  13. Cannot Open My Site(12)


 



- Lo-Fi Version Time is now: 11th October 2008 - 07:29 AM