Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 07-21-2006, 09:11 PM server status
Super Talker

Posts: 111
Trades: 0
Hey guys, I made a server status script, basically it checks if a game server is online or not.
and it works and all, but I need a little help.

I want it to check it every 3 minutes, not when some1 loads the page.
So basically, I want the script to check the server every 3 minutes to tell if its online or not.
Maybe this can be done with javascript and php?

thanks guys
martin
__________________

Please login or register to view this content. Registration is FREE
sixpacgenius is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-22-2006, 12:09 AM Re: server status
Webmaster Talker

Posts: 626
Trades: 0
If you want it running every 3 minutes regardless of the user. Meaning, regardless if a user is loading a page or not, if you want to update the status... Why not save a txt file or use a mysql database and run a cron job every 3 minutes to update that file/db.

Then you can setup a javascript loop to check the contents of the file as often as you want... Each time a page is loaded or more.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 07-22-2006, 03:38 AM Re: server status
Super Talker

Posts: 111
Trades: 0
Ya, thats what I was thinking at first.
Basically get the status, store in a text file, then call the text file.

But...I thought there would an easier way.
__________________

Please login or register to view this content. Registration is FREE
sixpacgenius is offline
Reply With Quote
View Public Profile
 
Old 07-22-2006, 06:11 AM Re: server status
mad_willsy's Avatar
Super Spam Talker

Latest Blog Post:
R&R Catering Hire Testimonial
Posts: 805
Name: Will Craig
Location: Cheltenham, Gloucestershire, UK
Trades: 0
Cron jobs are simple. Create a cron job that runs your script you have allredy made every 3 minutes.
__________________
Wont :P

Please login or register to view this content. Registration is FREE
mad_willsy is offline
Reply With Quote
View Public Profile Visit mad_willsy's homepage!
 
Old 07-22-2006, 06:00 PM Re: server status
Webmaster Talker

Posts: 626
Trades: 0
As suggested I would run the cron job every 3 minutes which will either create an entry in a file.

Then when the user loads the page, you can read the contents of the file to see what the status of the network is. This you can setup to run as often as you want using javascript or something.

I wouldn't run the script every three minutes when the user is on the site or i'm sure it would cause some huge problems if there were a lot of users on the site at any given time.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to server status
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44038 seconds with 12 queries