Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh

Status
Not open for further replies.

edd1e19

Programmer
Joined
Mar 22, 2004
Messages
72
Location
GB
Hi there,

I need a little help here please.

If you go to fill the form in the submit, it will then take you to a page, saying thank you. I would like this page to refresh after five seconds or so, and back to the original contact.php page
 
Php has header function for redirecting. However that function must be called before any output was sent to the page. If you have already printed out Thank you, php redirection won't work and you will have to use html or javascript:
Code:
HTML (goes into the <head>)
<meta http-equiv="refresh" content="5;url=contact.php" />

Javascript (goes anywhere on the page)
<script type="text/javascript">
 setTimeout("document.location.href='contact.php'", 5000)
</script>
Hope it helps.
 
That would require that your PHP script output either JavaScript or an HTML <META> tag to perform the redirection.




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top