tttt
05-21-2008, 03:04 PM
I am trying to load a session variable with a username and then, using an if statment display it if the condition is true the if atatement works but the session variable wont display the name. whats the problem?
here is my code:
<?php
session_start();
$_SESSION['name']=$name;
$username = $_POST[("userId")];
$password = $_POST[("Password")];
$dbc = mysql_connect...
$queryItem = "SELECT ...
if (empty($row)) //form validation
{
header("Location: logon.php");
}
else
{
$name = $row['user_name']; //place username into session id
echo $_SESSION['name']; //it doesnt display the name
}
?>
here is my code:
<?php
session_start();
$_SESSION['name']=$name;
$username = $_POST[("userId")];
$password = $_POST[("Password")];
$dbc = mysql_connect...
$queryItem = "SELECT ...
if (empty($row)) //form validation
{
header("Location: logon.php");
}
else
{
$name = $row['user_name']; //place username into session id
echo $_SESSION['name']; //it doesnt display the name
}
?>
