Jump to content


Redirecting from a thankyou page to home page.


2 replies to this topic

#1 Diaz

    Young Padawan

  • Members
  • Pip
  • 76 posts

Posted 01 June 2007 - 08:57 PM

Ok so i've been racking my brains. but i just can't come up with it..

How can i make a page show itself (for like 10 seconds) then redirect itself to another.

ie:

Thank you page (After a form has been submitted)

redirects to --

the home page

Any ideas?

Much appreciated. :)

#2 Tirus

    P2L Jedi

  • Members
  • PipPipPip
  • 764 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design, Programming, Music, Martial Arts

Posted 02 June 2007 - 12:00 AM

for html, put this code in between your <head> </head> tags:
<META HTTP-EQUIV="Refresh" CONTENT="10; URL=page.html">

----------
using php:
<?php
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10\" URL=page.html\">";
?>

Refresh tells the page to refresh, content=10 means the content is shown for 10 seconds (which is actually quite a long time if you think about it) and url=... is the page the user is being redirected to.

:)

Edited by Tirus, 02 June 2007 - 12:12 AM.


#3 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 02 June 2007 - 12:19 AM

Actually, your php example still uses html. The proper php example is this:
header('Refresh: 10;url=page.html');
But you should be warned that my specific example is deprecated and supposedly not supported by HTTP/1.1. It has worked on everything i've tested it on though.

p.s. Should you choose to use my example, make sure you know how to use headers first. Php.net has a full write up of how to use them, and it should be read before you ask any questions.

Edited by rc69, 02 June 2007 - 12:20 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users