hchsk Posted May 4, 2009 Share Posted May 4, 2009 i use php includes for several functions, from generating a line of text to a div with varying inner divs. how can i have these includes refresh continuously? i've looked into iframes with a meta refresh, but that requires the creation of an entire page, where i just want it to get the results of the script which may have changed. thanks for your time and any help. Quote Link to comment https://forums.phpfreaks.com/topic/156726-script-results-in-real-time/ Share on other sites More sharing options...
Ken2k7 Posted May 4, 2009 Share Posted May 4, 2009 You don't. PHP runs on the server. Once loaded, it doesn't reload. I would use AJAX. Quote Link to comment https://forums.phpfreaks.com/topic/156726-script-results-in-real-time/#findComment-825287 Share on other sites More sharing options...
Maq Posted May 4, 2009 Share Posted May 4, 2009 Ken is correct, it is impossible with pure PHP, you need to use AJAX, or something similar. Moving to AJAX section for further help. Quote Link to comment https://forums.phpfreaks.com/topic/156726-script-results-in-real-time/#findComment-825289 Share on other sites More sharing options...
law Posted May 4, 2009 Share Posted May 4, 2009 This example was an incredible help to me when I first started reading into AJAXish concepts http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm Quote Link to comment https://forums.phpfreaks.com/topic/156726-script-results-in-real-time/#findComment-825292 Share on other sites More sharing options...
hchsk Posted May 4, 2009 Author Share Posted May 4, 2009 makes sense, thanks guys. but how i cant quite figure out how i can get a variable from a php script using this? i only can find how to get document.myForm.time.value = ajaxRequest.responseText; which has to be echoed? Quote Link to comment https://forums.phpfreaks.com/topic/156726-script-results-in-real-time/#findComment-825316 Share on other sites More sharing options...
hchsk Posted May 4, 2009 Author Share Posted May 4, 2009 what i want it the return value of the script Quote Link to comment https://forums.phpfreaks.com/topic/156726-script-results-in-real-time/#findComment-825324 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.