Im Jake Posted August 4, 2008 Share Posted August 4, 2008 <?php include("includes/connection.inc.php"); $results = @mysql_query("SELECT id, name, ip, port, uptime, status FROM servers") or die(); while($values = mysql_fetch_array($results)){ list($online, $offline) = explode(',', $values['uptime']); $socket = @fsockopen(stripslashes($values['ip']), stripslashes($values['port']), $errno, $errstr, 1); if($socket){ $status = 'online'; $online = intval($online) + 1; } else{ $status = 'offline'; $offline = intval($offline) + 1; } $uptime = $online . ',' . $offline; echo 'Server: ' . $values['name'] . ' is ' . $status . '<br />'; $resultsUpdate = @mysql_query("UPDATE servers SET uptime='$uptime', status='$status' WHERE id=" . $values['id']) or die(); } $time = time(); $resultsTime = @mysql_query("UPDATE config SET lastupdate='$time'") or die(); ?> Thats my updating script.. server 10 mins it updates a server by pinging them for 1 second after 30 seconds the script times out . Will someone fix so that it pings more than one server or after pinging 20 servers it will take a short break and go again..? EDIT: Also, I'm asking you to do it for me because I have a hard time understanding programming languages and web languages and I don't know any of it... (except basic HTML) and I didn't make that script above. Link to comment https://forums.phpfreaks.com/topic/118017-updating-can-someone-do-it-for-me/ Share on other sites More sharing options...
trq Posted August 4, 2008 Share Posted August 4, 2008 Were not hear to write code for people but that is beside the point. If you really want this script to execute every second or so continuously you would need to look into a server side scheduler such as cron. PHP scripts wont run forever. Link to comment https://forums.phpfreaks.com/topic/118017-updating-can-someone-do-it-for-me/#findComment-607113 Share on other sites More sharing options...
MasterACE14 Posted August 4, 2008 Share Posted August 4, 2008 you will have to make sure it doesn't use up all your servers resources also, if your going to be running it every minute or whatever. Your webhost may not like that Link to comment https://forums.phpfreaks.com/topic/118017-updating-can-someone-do-it-for-me/#findComment-607119 Share on other sites More sharing options...
Im Jake Posted August 4, 2008 Author Share Posted August 4, 2008 Were not hear to write code for people but that is beside the point. If you really want this script to execute every second or so continuously you would need to look into a server side scheduler such as cron. PHP scripts wont run forever. not that -.- i need it to time out after pinging then pick up again i got cron jobs set every 10 mins Link to comment https://forums.phpfreaks.com/topic/118017-updating-can-someone-do-it-for-me/#findComment-607132 Share on other sites More sharing options...
Im Jake Posted August 4, 2008 Author Share Posted August 4, 2008 can someone please.. im offering a small amount of cash.. leave the source code that will work and your paypal email... Link to comment https://forums.phpfreaks.com/topic/118017-updating-can-someone-do-it-for-me/#findComment-607205 Share on other sites More sharing options...
revraz Posted August 4, 2008 Share Posted August 4, 2008 Freelance forum is best for this type of thing. Link to comment https://forums.phpfreaks.com/topic/118017-updating-can-someone-do-it-for-me/#findComment-607243 Share on other sites More sharing options...
Im Jake Posted August 4, 2008 Author Share Posted August 4, 2008 I just need this done for me. I'm only 15.. Link to comment https://forums.phpfreaks.com/topic/118017-updating-can-someone-do-it-for-me/#findComment-607543 Share on other sites More sharing options...
trq Posted August 4, 2008 Share Posted August 4, 2008 We don't do code for people. if you'd like some code written for you post your request in the freelance forum. What this has to do with your age is behond me. Link to comment https://forums.phpfreaks.com/topic/118017-updating-can-someone-do-it-for-me/#findComment-607585 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.