• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2206
  • 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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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