Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open php page from another php page.

Status
Not open for further replies.

bobrivers2003

Technical User
Oct 28, 2005
96
GB
I am trying to set up a simple login feature with php. But instead of echoing the html once the user has signed in I want to display a different page called access.php. The user logs into login.php, this calls auth.php I then want auth.php to call access.php which will display the access area. Is this possible?

auth.php:

if ($password =="test") {

"open access.php"
}else {

"open denied.php"

}

Many thanks
 
Code:
if ($password == "test") 
{
  header("Location: access.php");
}
else
{
  header("Location: denied.php");
}
Make sure there's no output sent to the browser before these calls. No html, no prints or echos and no whitespace above the opening <?php tag.
 
Fantastic stuff.

Thank you very much for the help, greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top