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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting a Page

Status
Not open for further replies.

Louth

Programmer
Jan 21, 2004
16
EU
Alright guys,

Would anybody be able to help me with the following problem?

I am trying to create a page which performs a number of SQL queries and then redirects to another page depending on the results of these queries. In other words I am trying to create a pure PHP page which never appears on screen but redirects to another page. The only solution I can think of is to create an intermediary page consisting of a button linking to the relevant page. I will paste the code here:

<?

include ('auth.php');

$do = mysql_query("select ind_id from db_ulp where login='$user'");

while ($result = mysql_fetch_array($do))
{
$ind_id=$result['ind_id'];
}

$ind = mysql_query("select status from db_individuals where ind_id=$ind_id");

while ($indStatus=mysql_fetch_array($ind))
{
$status = $indStatus['status'];
}

if ($status==member)
{
//I need to put something in here which will relocate the page to the following location:

location='access.php?page=members/member_details&ind_id=$ind_id';");
}
elseif ($status==trainee)
{
//same problem

location='access.php?page=trainees/trainee_details&ind_id=$ind_id';");
}

?>

If anybody could help me with this it would be much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top