Page 1 of 1

Sending a user to a specified page with PHP

Posted: Fri Feb 28, 2003 12:57 pm
by Exdaix
I need to send a user to a certain page depending if they typed in the correct info in a Login box or not.

Here is the example code, it might help you with my question:

Code: Select all

// Check to see if they were accepted, if so send them to thier specified pages
if ($accepted == "True")
	{
		// Send to voting page
	}
else
	{
		// Send to Oops! page
	}

Posted: Fri Feb 28, 2003 1:03 pm
by gdrums
I'm not sure if this is what you are looking for, but I've used...

Code: Select all

header("Location:index.php?fuseaction=home_page.news&page_id=2");
for sending a user to a specific page, kind of like a location tag.


Posted: Fri Feb 28, 2003 1:35 pm
by daven

Code: Select all

<?php
// Check to see if they were accepted, if so send them to thier specified pages
if ($accepted == "True")
   { // url can be a variable (like I have here) or hard-coded.  It can also be relative or absolute.
       header("Location: ".$your_url_goes_here);
   }
else
   {
       header("Location: ".$your_url_goes_here);
   } 
?>
http://www.php.net/manual/en/function.header.php for more information

Posted: Fri Feb 28, 2003 3:16 pm
by Exdaix
Great! Thanks.