Refresh PHP include()
include, php, refresh
Solution
To refresh only a portion of a page, you'll have to use some kind of Ajax Request : once the page has been sent to the browser, the server has done it's job, and cannot modify is anymore : the request of fetching a new portion of the page as to come from the browser.
You could do some Ajax requesting "by hand", it's not that hard ; but I'd rather suggest that you take a look at some of the great javascript frameworks that exists out there -- that might be helpful in the future, when adding more functionnalities to your application.
For instance :
- With prototype, you can use `Ajax.PeriodicalUpdater`
- Or, with jQuery, you could use something based on `$.load`
Problem
What is the best way to refresh the content of a var that is included? For example, I have this code: ``` <marquee> <?php include('note.php'); ?> </marquee> ``` This is great, as I can show on the page the contents of `note.php`. Say I change `note.php` but I don't want users refreshing to see the changes...is there any way to refresh the included file every 3 minutes for example?