gamelaster Posted December 27, 2011 Share Posted December 27, 2011 Hello guys, im programator, also im bad in english, please, how to create script for checking only on/off status??? Thanx .. Link to comment
0 Otto Posted December 27, 2011 Share Posted December 27, 2011 Title sais with PHP. Well if you want to know if a server is on/off you should try this: header(”Content-type: image/jpg”); $server = “207.154.202.100″; $port = “5278″; $images = “imagenes/”; @$state = fsockopen($server, $port, $errno, $errstr, 10); if ($state) { $image = imagecreatefromjpeg($images . “online.jpg”); } else { $image = imagecreatefromjpeg($image . “offline.jpg”); } imagejpeg ($image); imagedestroy ($image); ?> Well, try that. Then create a folder called "Images" and add online.jpg and offline.jpg This is a simple code of PHP you just have to change the variables $server and $port. If you get some syntax error, probably is because of those quotes. I tried to change the script to english, because the original one is on spanish. If $image doesn't run or you get error, try this: "$ruta_img" ?> /> Link to comment
Question
gamelaster
Hello guys, im programator, also im bad in english, please, how to create script for checking only on/off status??? Thanx ..
Link to comment
1 answer to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now