How to Refresh a Page Using PHP?

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
Gunner
Posts: 276
Joined: Sun Aug 14, 2011 12:07 am

How to Refresh a Page Using PHP?

Post by Gunner »

How to Refresh a Page Using PHP?
I have been searched all over the search engine, but I cannot find the spesific answer. I hope IRC (Indie-Resource Community) know this case..

Thanks!

-Gunner
Skype: mrvictordiaz
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: How to Refresh a Page Using PHP?

Post by SpiritWebb »

Code: Select all

<META HTTP-EQUIV=Refresh CONTENT="3; URL=http://www.yoursite.com/yoururl.php">
This will refresh the page every 3 seconds
Image

Image
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: How to Refresh a Page Using PHP?

Post by Jackolantern »

For the record, meta refreshes are legacy, and are now discouraged by the W3C. Instead, they suggest to do it through Javascript, where you can have much more control over the refresh (such as pausing refreshes when the user starts trying to interact with a form element, etc.).

However, you are correct that meta-refreshes are the only method of causing page refreshes in PHP ;)
The indelible lord of tl;dr
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: How to Refresh a Page Using PHP?

Post by SpiritWebb »

sshh..dont care W3C!! :roll:
Image

Image
User avatar
Gunner
Posts: 276
Joined: Sun Aug 14, 2011 12:07 am

Re: How to Refresh a Page Using PHP?

Post by Gunner »

Hi,
Thank you for your answer!
But what I'm looking is to refresh page once. Because in my game, I used profile description. Whenever user submit their new description, the description is same as before. So I need a PHP script to refresh it automatically ;)
Skype: mrvictordiaz
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: How to Refresh a Page Using PHP?

Post by Xaleph »

That`s a workaround, not a solution. What you need to do is start retrieving data AFTER forms are handled and updated. That way you don`t need refreshes.
Post Reply

Return to “Beginner Help and Support”