First off, I have session.autostart turned on and IM using HTTP_SESSION_VARS, but I dont think Im using them right, apparently.
I am trying to write a log-on script for my website, where users can register and log-on to use some of the features.
I have two different scripts, the first is the actual page where they register/log-on, the other has the log-on form.
This is the one with the log-on form.
Code: Select all
<?php
global $HTTP_SESSION_VARS;
if ($HTTP_SESSION_VARSї'logged_in'] == true)
{
echo "<b>".$HTTP_SESSION_VARSї'user_name']."</b>";
echo "<form action='users.php?logout=lo' method='post'>";
input("submit","submit", "Logout");
echo "</form>";
}
else
{
?>
<form action="users.php?ver_login=vl" method="post">
<?php input("text","user_name", "Username", 20, 20); ?>
<br>
<?php input("password","user_pass", "", 20, 20); ?>
<br>
<?php
input("submit","submit", "Login");
input("reset","reset", "Reset");
}
?>
?>This is where it actually sets the user to being logged in after the various tests in users.php...
Code: Select all
{
$query = "SELECT user_name, user_id from users where LCASE(user_name)='";
$query .= strtolower($user_name)."'";
$result = mysql_query($query);
if ($result)
{
global $HTTP_SESSION_VARS;
$row = mysql_fetch_assoc($result);
$HTTP_SESSION_VARSї'user_name'] = $rowї'user_name'];
$HTTP_SESSION_VARSї'user_id'] = $rowї'user_id'];
$HTTP_SESSION_VARSї'logged_in'] = true;
echo "<div class='title'>Logged In</div>\n";
echo "Thank You for Logging In.\n";
}
}Its probably just something very minor that I overlooked, but I read through the manual quite a few times and don't really see anything wrong.
Any help is greatly appreciated.
-TwinkiE