This topic is locked

Straight to page after registration

2/21/2007 10:39:28 AM
PHPRunner General questions
M
mmponline author

I got this code earlier to go straight to a specific page after registration. It now goes back to the logon page with a "session has expired" message.
Why?

function AfterSuccessfulRegistration()

{
global $userdata;

$_SESSION["UserID"] = $userdata["Username"];

$_SESSION["OwnerID"] =mysql_insert_id();

header("Location: _PlayerInformation_add.php");

exit();
}
J
Jane 2/22/2007

Stephan,
try to use the following code:

function AfterSuccessfulRegistration()

{

global $values;

$_SESSION["UserID"]= $values["Username"];

$_SESSION["OwnerID"] =mysql_insert_id();

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;

$_SESSION["GroupID"]="admin";

header("Location: _test_add.php");

exit();

}

M
mmponline author 2/22/2007

Nope
Still get an: "Your session has expired. Please login again. "
When logging in, it then goes to right page.
Do I have to change anything in the code, like field names or something?
Thanks for your help.

J
Jane 2/22/2007

Stephan,
you need to change admin with your correct value of GroupID.

M
mmponline author 2/22/2007

Perfect! - Thanks