Solved

Redirect to another page

Posted on 2004-08-05
3
2,199 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
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…

752 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