Redirect

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ridgeman
Forum Newbie
Posts: 2
Joined: Fri Oct 16, 2009 9:41 am

Redirect

Post by ridgeman »

I have a page that I send people to to download a file. That page is PHP. At the end of the download, I want the people sent back to my original page which is HTML. Any help would be appreciated.
User avatar
desperado
Forum Commoner
Posts: 46
Joined: Wed Dec 10, 2008 8:49 am

Re: Redirect

Post by desperado »

if your dowload page is all script (you do not output text like "downloading file...please wait", then add the following at the end of the script:

Code: Select all

header('Location: http://www.example.com/');
if you do spit out something, do it with javascript:

Code: Select all

<script>
setTimeout ("window.location.href='http://www.example.com/'", 1000);
</script>
(you can echo this in php, it will work too.)
ridgeman
Forum Newbie
Posts: 2
Joined: Fri Oct 16, 2009 9:41 am

Re: Redirect

Post by ridgeman »

Thanks, I'll give it a try.
Post Reply