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.
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.