display session variable
hi,
i need help on how to do this.
on my log in page, i did (server behavior > SecurityAssist authenticate user> and created a session variable first_name.
here is the code for the log in page:
<?php require_once('Connections/boulevardstyle.php'); ?>
<?php require_once('Connections/boulevardstyle.php');?>
<?php require_once('Connections/boulevardstyle.php');?>
<?php require_once('Connections/boulevardstyle.php');?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if(isset($_POST["button_x"])){
$WA_Auth_Parameter = array(
"connection" => $boulevardstyle,
"database" => $database_boulevardstyle,
"tableName" => "users",
"columns" => explode($WA_Auth_Separator,"emailaddress".$WA_Auth_Separator."password"),
"columnValues" => explode($WA_Auth_Separator,"".$row_users[''] ."".$WA_Auth_Separator."".((isset($_POST["password"]))?$_POST["password"]:"") .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"1st_name"),
"sessionNames" => explode($WA_Auth_Separator,"first_name"),
"successRedirect" => "index1.php",
"failRedirect" => "re_userLogIn.php",
"gotoPreviousURL" => TRUE,
"keepQueryString" => FALSE
);
WA_AuthenticateUser($WA_Auth_Parameter);
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_boulevardstyle, $boulevardstyle);
$query_users = "SELECT * FROM users";
$users = mysql_query($query_users, $boulevardstyle) or die(mysql_error());
$row_users = mysql_fetch_assoc($users);
$totalRows_users = mysql_num_rows($users);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['emailaddress'])) {
$loginUsername=$_POST['emailaddress'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "index1.php";
$MM_redirectLoginFailed = "re_userLogin.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_boulevardstyle, $boulevardstyle);
$LoginRS__query=sprintf("SELECT emailaddress, password FROM users WHERE emailaddress=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $boulevardstyle) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
and this is the page code where i want the 1st name of the user to be displayed:
<?php require_once('Connections/boulevardstyle.php'); ?>
<?php require_once('Connections/boulevardstyle.php');?>
<?php require_once('Connections/boulevardstyle.php');?>
<?php require_once('Connections/boulevardstyle.php');?>
<?php