Solved

Redirect to another page

Posted on 2004-08-05
3
2,188 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
  • 3
3 Comments
 
LVL 27

Accepted Solution

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

Expert Comment

by:Diablo84
Comment Utility
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
Comment Utility
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now