This topic is locked

check value of field after login and divert to page

4/23/2012 17:10:17
PHPRunner General questions
S
scoobysteve author

I would like to have each member who signs on to be diverted to one of two pages based on the numeric value of a field. Is this possible in PHPR6.1 in the "after successful login" event.

I would like it to be greater than 300 to one page and less than that to another page.
Thanks in advance

Steve

C
cgphp 4/23/2012

If the numeric value is in the same table of the "authentication" table (where user and password are stored), enter the following code in the "After successful login" event:

if($data['numeric_value_field_name'] >= 300)

{

header("Location: onepage_list.php");

}

else

{

header("Location: anotherpage_list.php");

}
exit();


If the numeric field value is in another table, you have to fetch it before the redirection.

S
scoobysteve author 4/24/2012



If the numeric value is in the same table of the "authentication" table (where user and password are stored), enter the following code in the "After successful login" event:

if($data['numeric_value_field_name'] >= 300)

{

header("Location: onepage_list.php");

}

else

{

header("Location: anotherpage_list.php");

}
exit();


If the numeric field value is in another table, you have to fetch it before the redirection.


Works a treat, thank you sir, much appreciated, Steve