I cannot get my session information to store, I know I am doing something wrong but I cannot seem to get the UNAME and PASS variables to store?
index.php
<?
session_start();
session_register("module");
session_register("UNAME");
session_register("PASS");
global $module, $UNAME, $PASS;
$module="login.php";
include "$module";
?>
login.php
<?php
function showlogin($username="", $password="") {
?>
<FORM ACTION="<?=$PHP_SELF?>" METHOD="Post">
Username:<INPUT TYPE=text NAME=username VALUE="<?echo $username?>">
<BR>
Password:<INPUT TYPE=text NAME=password VALUE="<?echo $password?>">
<BR>
<INPUT TYPE="submit" VALUE="login">
</FORM>
<?
$UNAME=$username;
$PASS=$password;
}
if(!isset($UNAME)) {
showlogin();
}
else
{
$passwd="test";
if ($PASS==$passwd)
{
echo("logged in ");
}
else
{
echo("There was problem with your username or password<BR>");
showlogin($UNAME,$PASS);
}
}
?>