Do the sk8 Posted November 3, 2009 Share Posted November 3, 2009 Trying to ping an IP and port, it worked before, I didn't even edit it, and now it's just a blank page.. <?php $ip = "localhost"; $port = "80"; //pinging to check online function checksts($ip, $port, $timeout=5) { $connect = fsockopen( $serveraddr, $port, $errno, $errstr, $timeout ); if ( ! $connect ){ $ror = "<font color=\"red\"><b>Offline</b></font>"; echo "1"; } else { $ror = "<font color=\"green\"><b>Online</b></font>"; echo "2"; }} ?> I'm pretty sure it's pinging, because; 1. Localhost replies to 80 due to it's running off localhost, and the server is on. 2. It worked before.. Any help? Quote Link to comment https://forums.phpfreaks.com/topic/180131-im-confused/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 3, 2009 Share Posted November 3, 2009 The posted code is a function definition. Where are you calling that function? Quote Link to comment https://forums.phpfreaks.com/topic/180131-im-confused/#findComment-950234 Share on other sites More sharing options...
Do the sk8 Posted November 3, 2009 Author Share Posted November 3, 2009 When posting on an external page, I can make it echo, which is what the $ror variables are for. Edit; Quoted out the function line, works, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/180131-im-confused/#findComment-950235 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.