I am learning php so i dont know much yet but this question might be easy for you guys.
is this rly bad way show the server status?
i tried with my localhost (127.0.0.1) (80) it was working fast
but when i tried with the hamachi ip and the port it was taking so long and then not even loading the whole website.
any suggestion how i should control the status?
Code:
if (!$socket = @fsockopen("25.206.182.32", 5816, $errno, $errstr, 30))
{
echo "<font color='red'><strong>Offline!</strong></font>";
}
else
{
echo "<font color='green'><strong>Online!/strong></font>";
fclose($socket);
}
i tried with my localhost (127.0.0.1) (80) it was working fast
but when i tried with the hamachi ip and the port it was taking so long and then not even loading the whole website.
any suggestion how i should control the status?