Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2209
  • Last Modified:

Redirect to another page

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
donb1
Asked:
donb1
  • 3
1 Solution
 
Diablo84Commented:
header("location: page.php");
exit;
0
 
Diablo84Commented:
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
 
Diablo84Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now