I dont think I am doing this correctly. Sorry I am a newby..
I can get it to login and display the username, but if you leave the page and come back to it.. it wont show the username again of the person who just loged in. I dont think the cookie is being set correctly.
Here is the code that I am using...
[php]
if ($mode == 'login')
{
post('un,up');
$unn = mysql_escape_st ring($un);
$upp = mysql_escape_st ring($up);
$qc = mysql_query("SE LECT * FROM `instructors` WHERE `username` = '$unn' AND `password` = '$upp' AND `isadmin`='1'") ; if (mysql_num_rows ($qc) > 0)
{
$rc = mysql_fetch_ass oc($qc);
extract($rc);
$logged = 1;
session_registe r('logged');
$_SESSION['logged'] = $id;
session_registe r('MyID');
$_SESSION['MyID'] = $id;
$mode = '';
}
else $error = "<span class='text'><f ont color=red>Incor rect login information</font></span>";
}
if (!isset($_SESSI ON['logged']))
{
include ("navtop.php ");
include ("nav.php");
echo "
[/php]
Thanks
I can get it to login and display the username, but if you leave the page and come back to it.. it wont show the username again of the person who just loged in. I dont think the cookie is being set correctly.
Here is the code that I am using...
[php]
if ($mode == 'login')
{
post('un,up');
$unn = mysql_escape_st ring($un);
$upp = mysql_escape_st ring($up);
$qc = mysql_query("SE LECT * FROM `instructors` WHERE `username` = '$unn' AND `password` = '$upp' AND `isadmin`='1'") ; if (mysql_num_rows ($qc) > 0)
{
$rc = mysql_fetch_ass oc($qc);
extract($rc);
$logged = 1;
session_registe r('logged');
$_SESSION['logged'] = $id;
session_registe r('MyID');
$_SESSION['MyID'] = $id;
$mode = '';
}
else $error = "<span class='text'><f ont color=red>Incor rect login information</font></span>";
}
if (!isset($_SESSI ON['logged']))
{
include ("navtop.php ");
include ("nav.php");
echo "
[/php]
Thanks
Comment