Hi.. Is there any command to refresh a page? For example, I have a link in page1.php which takes me to page2.php. Again there is a link in page2.php which gets me back to page1.php. But every time when I am coming back to page1.php from page2.php, I want my page1.php to be refreshed to get the new data. As of now it wont get refreshed and I need to click the refresh button and its showing me the needed contents. Is there a way by which I could automatically refresh page1.php either after clicking on the link or before clicking on the link for page1.php? Thanks in advance.
Your browser is probably has probably cached the page - hence just shows it again without reloading. There's probably a more elegant solution than this... but you could just add a unique parameter to the url each time you redirect (even though nothing gets done with it). E.g. page2.php?unique_parameter=25467423 page1.php?unique_parameter=99479797 page2.php?unique_parameter=78748759 - e.g. generate a random number each time, making the browser think that its a completely new page.
You can try what PJB said, but... It is SEO unfriendly. However, a good solution Just put a ?xyz=time() However, a data refresh can be done by using AJAX (or even more simple.. jQuery) or by a real refresh. Depending on your situation. "Real" refresh (like F5) can be done by adding a meta tag: <meta http-equiv="refresh" content="sec" /> HTML: However, this is a timed refresh, which refreshes the page every sec seconds. Maybe you can combine it with iFrame or something Hope I helped you
That's a good point - if seo is important my suggestion isn't a good idea - I was thinking that it was an admin page or such like. Though you could use Google's canocial tag (google "Specify your canonical") to overcome this (but I'm not sure how many other search engines recognize this).
The "correct" way to do this is to tell the browser not to cache the page, by using the appropriate headers. Unfortunately browser support for this has varied over time, so you need a cocktail of headers to make it work reliably.
Hi.. I tried using all these commands. But I still have an issue related to this. For example, for the first time when I am going to page2.php from page1.php my page1.php is getting refreshed (I gave time() in the url). Again when I go from page1.php to page2.php. Now the next time when I am coming back to page1.php (by clicking the link), my page1.php is not getting refreshed.. Could anyone please help me on this.. (I apologize if my questions are sounding too stupid.. I am totally new to this.) Thanks..
Yes.. I am refreshing it manually now and it works.. But I want the page to get refreshed by itself.. Any other suggestion please? Thanks for your reply..
I'm out of ideas sorry! Have you tried using a different browser (firefox, chrom, ie)? Have you tried messing about with your browsers settings? E.g. in IE you can go into Tools->InternetOptions then BrowsingHistory Settings to tell it to always refresh).