pclever1
pclever1

Reputation: 105

PHP header redirect and HTML refresh

I am working with a php login page that redirects people to user specific pages. When the user gets to these pages it still shows the php login page in the url.

Can you help me find a way for the html (or php) code on the new page to reload the page one time so it becomes that page AFTER IT REDIRECTS. (I am having functionality problems with these pages because of this problem)?

Upvotes: 3

Views: 4896

Answers (1)

anon
anon

Reputation:

You cannot use PHP to refresh the page. Once the page is loaded into the browser, PHP is out of control and cannot modify the page contents.

To reload/refresh the document, you can use HTML or JavaScript.

To refresh the document every 30 seconds using HTML:

<meta http-equiv="refresh" content="30"> 

Using JavaScript:

<input type="button" value="Reload Page" onClick="window.location.reload()">

Hope this helps!

Upvotes: 1

Related Questions