Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 10th, 2003, 12:28 PM
Authorized User
Join Date: Sep 2003
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Redirects

When a user successfully authenticates how do I automatically redirect them to another page?

Old October 10th, 2003, 12:50 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts

In PHP, you can use the header() function to send the "Location" header to the client's browser. For example:

  header("Location: other_page.php");

You need to call this function BEFORE any output has been sent to the browser; HTTP headers are always sent before any HTML content.

If you'd prefer, you can also use javascript or a meta refresh tag. Lots of examples of these, just search for them:

Take care,


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Management / Security / Redirects justinhume Beginning PHP 5 March 3rd, 2004 08:43 PM
HTTP_REFERER Tester Sometimes Redirects OK Visitor markw707 Classic ASP Basics 4 August 21st, 2003 11:41 PM
Querystrings and Redirects hcweb Classic ASP Basics 3 July 30th, 2003 08:50 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.