Forums
This topic is locked
Login-Problem with $KT_Username - often dicussed..
Posted 11 Jan 2002 17:17:20
1
has voted
11 Jan 2002 17:17:20 Thorsten Röver posted:
Hi there,I know, it was often discussed, but I still have problems:
I have created a login page with the text fields login and password using the PHAkt User Login behavior. Now I want to hand on the content of login to the next page, so that I can either display it there. The data is stored in a session variable called $KT_Username, I know. But when I put $KT_Username on my welcome page nothing is displayed. I input the session_start() at the top, too, but nothing happens. Goodness, who can help me?
Is there anything wrong in the Login-Page-Code? Here is the relevant part of it:
<?php
// *** Start the session
session_start();
// *** Validate request to log in to this site.
$KT_LoginAction = $PHP_SELF;
if ($QUERY_STRING!=""
if (isset($Benutzername)) {
$KT_valUsername=$Benutzername;
$KT_fldUserAuthorization="";
$KT_redirectLoginSuccess="/product_search.php";
$KT_redirectLoginFailed="/index.php";
$KT_rsUser_Source="SELECT Benutzername, Passwort ";
if ($KT_fldUserAuthorization != ""
$KT_rsUser_Source .= " FROM Tbl_PA WHERE Benutzername='" . $KT_valUsername . "' AND Passwort='" . $Passwort . "'";
$KT_rsUser=$connRoever->Execute($KT_rsUser_Source) or DIE($connRoever->ErrorMsg());
if (!$KT_rsUser->EOF) {
// username and password match - this is a valid user
$KT_Username=$KT_valUsername;
session_register("KT_Username"
if ($KT_fldUserAuthorization != ""
$KT_UserAuthorization=$KT_rsUser->Fields($KT_fldUserAuthorization);
} else {
$KT_UserAuthorization="";
}
session_register("KT_UserAuthorization"
if (isset($accessdenied) && false) {
$KT_redirectLoginSuccess = $accessdenied;
}
$KT_rsUser->Close();
session_register("KT_login_failed"
$KT_login_failed = false;
header ("Location: $KT_redirectLoginSuccess"
exit;
}
$KT_rsUser->Close();
session_register("KT_login_failed"
$KT_login_failed = true;
header ("Location: $KT_redirectLoginFailed"
exit;
}
?>