No, It's not ok. Why would there be functions in PHP if you do not use them?
Also you do not close the connections in case they opened successfully.
PHP Code:
/** * Ping IP @ Port * * @param string $ip The IP of the computer you want to ping * @param integer $port The port that should be pinged * * @return boolean */ function ping($ip, $port = 22) { $serror = 0; $serrorstr = 0; $ps = @fsockopen($ip, $port, $serror, $serrorstr, 1); if(!$ps) { return false; } else { fclose($ps); return true; } }
BTW, it's not good to open the database port to the world. You should better close that port and only connect to it locally on the remote machine.
No, It's not ok. Why would there be functions in PHP if you do not use them?
Also you do not close the connections in case they opened successfully.
PHP Code:
/**
* Ping IP @ Port
*
* @param string $ip The IP of the computer you want to ping
* @param integer $port The port that should be pinged
*
* @return boolean
*/
function ping($ip, $port = 22)
{
$serror = 0;
$serrorstr = 0;
$ps = @fsockopen($ip, $port, $serror, $serrorstr, 1);
if(!$ps)
{
return false;
}
else
{
fclose($ps);
return true;
}
}
BTW, it's not good to open the database port to the world. You should better close that port and only connect to it locally on the remote machine.
There should be "$ip = "127.0.0.1" and $port = "443" " for example?
[How To]ICQ Status-checker 09/04/2010 - Tutorials - 2 Replies Hier zeige ich euch wie ihr euren ICQ-Status zum Beispiel in eure Signatur stellen könnt.
Es funktioniert nur bei Nummern, die über die Suchfunktion gefunden werden können! Das heißt sie müssen clean sein.(dürfen nicht invisible sein)
1. Sucht euch eins von diesen Bildern aus:
1. http://informer.uinov.ru/status/8/123456789.png
2. http://informer.uinov.ru/status/9/123456789.png
3. http://informer.uinov.ru/status/10/123456789.png
4. http://informer.uinov.ru/status/11/123456789.png
5....
[Help]Status Checker! 07/23/2009 - CO2 Private Server - 0 Replies Hey Guys, I have a problem with the status of my server, i execute CoMy.exe when the window finish loading says : Server Running on Ip: and my ip
but in Blackout Gaming - Projects says my server is off? my firewall isnt connected and i dont know why the problem...
who can help me?
SJSRO and Sun SRO Status checker! 07/12/2009 - SRO Private Server - 10 Replies Hey guys, I made this simple program to check server registration status, be sure to read the ReadMe.
It's an HTML document so you don't have to install it.
I need a status Checker! 04/13/2009 - CO2 Private Server - 3 Replies Ok this is kinda difficult but it can be done
i need a status checker to tell how many people are online
but the problem is our db is ini files not a mysql so if you could please help me that would be great!
thanks,
LeGend
andreaco.tk