Nov 21, 2009

Refresh Php Page, But First .....

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > HTML, XML etc..

Refresh Php Page, But First .....

kvarnerexpress
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!

Comment/Reply (w/o sign-up)

xJedix
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

CODE
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.....

Comment/Reply (w/o sign-up)

OpaQue
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 :-)


Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : refresh, php, page

  1. Refresh Main Window By Clicking Link In Popup?
    (2)
  2. Refresh Page After Back Button Hit
    (14)
    Hi. I have a page that is dynamically build through DOM manipulation. So, when I browse outside the
    page, and then click back, those dynamically created DOM objects are gone. Since I am also using JSP
    / Servlet technology, I can rebuild this page easily, which I have done. Here is my dilemma. If
    the user leaves the dynamic page, then clicks back on their browser, I need the page they are going
    back to to refresh. I can't figure out how to do this. I've tried using the META tag, but it
    won't do it. Help would be appreciated. Thanks. ....
  3. Making A Refresh Link On Your Website.
    refresh local webpage (17)
    /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> post it on ur website
    CODE refresh It can refresh local webpage. U can add it at ur forum so that each topic u
    are reading can be refresh easily. If ur website return to homepage after pressing I.E. refresh
    button, then u must need this coding. /cool.gif' border='0' style='vertical-align:middle'
    alt='cool.gif' /> Beacus visitors only want to refresh local webpage but not go back to homepage.
    /ohmy.gif' border='0' style='vertical-align:middle' alt='ohmy.gif' /> * same co....
  4. Auto Refresh
    after page loads (13)
    Okay this seem like a siple enough task, I would like to tell an html page to refresh, but two
    conditions have to be met, 1) the page must have finsihed loading, 2) it must wait a given number of
    seconds, say 5. Buy the way this needs to be automatic. Thanks....
  5. Refresh Web Page
    (7)
    Well this questioned wasnt answered in 2003 but hopefully somebody knows the answer, sorry if this
    is a simple question but can i force the web browser to refresh the page after pressing the submit
    button. Basically my cgi perl form copies a different jpeg with teh same name into my public_html
    folder every time the form is submitted, therefore i have to click on the refresh button in IE to
    see the different picture. I have tried Code: but it doesnt seem to work in IE6 ....

    1. Looking for refresh, php, page

Searching Video's for refresh, php, page
See Also,
advertisement


Refresh Php Page, But First .....

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com