sawade Posted January 30, 2010 Share Posted January 30, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/190353-page-refresh/ Share on other sites More sharing options...
premiso Posted January 30, 2010 Share Posted January 30, 2010 Javascript / AJAX would need to be used to accomplish what you want. Quote Link to comment https://forums.phpfreaks.com/topic/190353-page-refresh/#findComment-1004235 Share on other sites More sharing options...
sawade Posted January 31, 2010 Author Share Posted January 31, 2010 What about a do while loop? Quote Link to comment https://forums.phpfreaks.com/topic/190353-page-refresh/#findComment-1004499 Share on other sites More sharing options...
premiso Posted January 31, 2010 Share Posted January 31, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/190353-page-refresh/#findComment-1004502 Share on other sites More sharing options...
sawade Posted February 1, 2010 Author Share Posted February 1, 2010 That's what I figured. Darn. I suck at Javascript! LOL Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/190353-page-refresh/#findComment-1005247 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.