Hey all..
THis seemed simple enough.. create a user login.. then if username/pass is correct start a session and set the vars i need..
<?
$connection = odbc_connect("intradb","dbaccess","dbaccess");
$query = "Select username, password, group, SecLev from users ";
$query .= "where username = '$username' and password = '$password'";
$result = odbc_do($connection, $query);
if((odbc_result($result, 1) == $username) and (odbc_result($result, 2) == $password))
{
session_start();
session_register('name');
session_register('group');
session_register('seclevel');
$name = odbc_result($result, 1);
$group = odbc_result($result, 3);
$seclevel = odbc_result($result, 4);
echo "<script language='JavaScript'>window.location.replace('http://www.spectrumglobalonline.com/intranet/mainmenu.php')</script>";
}
else
{
echo "<script language='JavaScript'>window.location.replace('http://www.spectrumglobalonline.com/intranet/index2.php')</script>";
}
odbc_close($connection);
?>
problem is that when i try to use $name, $group, or $seclevel on any other pages I get an undefinded var message.. I think this is just a scope problem but my understanding was that session vars are global when set.
If someone could shed some light on this I would appreciate it.
Thanks