Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Refresh Php Page, But First .....

Recommended Posts

I'm working on this now, but I can't even think of how to write it, if it's possible (but I'm pretty sure it is)...I have a page, which has a small iframe on it which loads a php page showing the status of a server, and refreshes itself every 30 seconds or so.. that works fine.. the only problem is, when it refreshes, it seems to take at least 1 second to show anything, and I don't like it going blank like that.. my question is, can I set the php to check the status every 30 seconds, and check to see if it's different from before, and if so, then update the iframe, if not, don't do anything at all?I don't know php well (but I can work my way through code and figure out what it does) so, I'm hesitant to try anything.. I have a feeling I'll end up not actually checking the server status and just checking if a variable is equal to itself, or something like that.. I dunno. help if ya can thanks!

Share this post


Link to post
Share on other sites

I, myself am not really good with php.... But I think this is what you would do. Have the script get te status of the server, then have something like

if($status != !statuscheck){echo('do whatever update to the status of the server here');}

I'm guessing that would work. I think to get rid of the delay, you would want to get the info then check to see if its the same or not, and then have it post the new info if it is different. Just make sure you have the if statement in the loop you are using to have it check every 30 secs.

Hope it helps, remember I'm not really good at php.....

Share this post


Link to post
Share on other sites

If you are refreshing a PAGE, the blank thing will be there. If you want to avoid things like that, then you need a dose of AJAX! This is the same technology which makes pages in GMAIL super duper fast and robust :-)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.