Jump to content

Recommended Posts

I have a question:  What I want to happen is if a variable is not empty for the page to reload whichout a button or link.  So an automatic refresh/reload once a certain variable has been filled.  I am thinking this will need to be done with javascript since php is a server side language.  Am I correct?  I have written a php code that does work for this, but i have to click a button to run the code.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/190353-page-refresh/
Share on other sites

A do / while would probably work if you never let the script exit until you tell it to. But doing so could eat up your Server Resources and make your site sluggish depending on how many users use it. As multiple processes constantly running like that on the server will eat up the resources.

 

AJAX / Javascript is a much better solution. You could also possibly have that in an iframe and just have the iframe constantly refreshing, but that would still require Javascript.

Link to comment
https://forums.phpfreaks.com/topic/190353-page-refresh/#findComment-1004502
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.