Is there any other way except echoing meta refresh tags and header to direct the user to another page from a php script?
server-side is always preferred.
Go to a page with php
Moderator: General Moderators
Re: Go to a page with php
Code: Select all
header("Location: http://www.mysite.com/mypage.php");Re: Go to a page with php
My server outputs a 500 server error, whenever I try to use it for files that are on the server (index.html) but not for external links (e.g. http://www.google.com).
Re: Go to a page with php
You need to use full paths. Like my example.
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Go to a page with php
Also, I think this works...
Code: Select all
header('REFRESH', '0;URL=http://someaddress.com/some_file');- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Go to a page with php
No it won't. Header sends a HTTP header and it's just the first argument which contains the string. The second is a boolean.PHPyoungster wrote:Also, I think this works...Code: Select all
header('REFRESH', '0;URL=http://someaddress.com/some_file');
http://au2.php.net/header