Page 1 of 1
Redirecting after printing text
Posted: Sat Jun 14, 2008 2:22 pm
by Restrikted
I've been searching for a while how to do this with no luck. What I want to do is after the person submits a form, the page tells them their submission was successful, and after about 3 seconds redirect them back to to the login page. Obviously I can't use header('Location: login.php'), since I've already output the form and confirmation onto the page. Is there any way to do redirect after printing text?
Re: Redirecting after printing text
Posted: Sat Jun 14, 2008 2:24 pm
by onion2k
You could use a meta refresh*. I'd just give the user a link to click on though in case they read slowly.
*
http://en.wikipedia.org/wiki/Meta_refresh
Re: Redirecting after printing text
Posted: Sat Jun 14, 2008 6:37 pm
by Restrikted
That worked perfectly. Thanks.
Re: Redirecting after printing text
Posted: Sat Jun 14, 2008 9:08 pm
by LSJason
Or, you can use a Javascript refresh:
Code: Select all
<script type="text/javascript">window.location="NEW URL";</script>