RE: [PHP] [Q] Howto go directly to a URL?
| From: | Chris W. Parker | Date: | Fri, 13 Feb 2004 21:09:05 +0000 |
| Subject: | RE: [PHP] [Q] Howto go directly to a URL? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177646@lists.php.net to get a copy of this message | ||
Michael T. Peterson <mailto:mtp1032@comcast.net>
on Friday, February 13, 2004 1:03 PM said:
> I have written a very straightforward user login script. Once the
> user successfully logs in, I would like my PHP script to take him
> directly to the home page.
[snip]
> Can I avoid that intermediate step, somehow? When my script logs in
> the user, how to I write the code that dispatches directly to the
> home page?
Yes it's called redirecting. You do it via the HTTP headers.
header("Location: http://www.FullyQualifiedDomainName.com/page.php");
You'll undoubtedly come across some errors when you first try this. Let
me give you a hint and say.. TRUST THE ERROR(S) REPORTED BY PHP.
chris.