Solved

Redirect to another page

Posted on 2004-08-05
3
2,201 Views
Last Modified: 2008-03-10
I have a php page that does some things, but prints nothing.  I would like to add a statement at the end that redirects to another page.  I can do this in asp, but don't know how to do it in php.
Thanks.
0
Comment
Question by:donb1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 27

Accepted Solution

by:
Diablo84 earned 125 total points
ID: 11731802
header("location: page.php");
exit;
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 11731811
you should technically use absolute pths (ie. a full url or the path from the root) although all browsers to my knowledge support relative paths (ie. the others files location relative from where the current file is).

exit; is not essential but ensures that no other code is processed after the header redirect.

The code must go before any out put including html, php (echo/print) and in some cases new lines and spaces

Diablo
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 11731813
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question