can someone tell me what i'm doing wrong.... its like not sending the information to the next page or somethin, i dunno...
login.php...:
$passwd = md5($_POST['passwd']);
$dbuser = 'Blade';
$dbpass = '****';
//connect to the DB and select the database
$connection = mysql_connect('localhost', $dbuser, $dbpass)
or die(mysql_error());
mysql_select_db('Hazardnet', $connection) or die(mysql_error());
//set up the query
$query = "SELECT * FROM HN_users
WHERE username='$username' and passwd='$passwd'";
//run the query and get the number of affected rows
$result = mysql_query($query, $connection) or die("error making query");
$affected_rows = mysql_num_rows($result);
//if there's exactly one result, the user is validated. Otherwise, he's invalid
if($affected_rows == 1){
session_register("username");
session_start("username");
print "Thank your for logging in, <strong>$username</strong>, Please continue into the <a href=\"/members/members.php\">members area</a>";
}
else{
print 'Sorry, you seem to have entered an incorrect Username/Password.';
}
logincheck.php...:
<?
if(!isset($_SESSION['username']))
{
die('
An error has ocurred. It may be that you have not logged in, or that
your session has expired. Please try <a href="/"><u>logging in</u></a> again or
<a href="/?HNC=register"><u>Registering</u></a><br /><br />
For further questions email the <a href="mailto:Mark00018@hotmail.com"><u>Web Master</u></a>
');}
else{print "Welcome!";}
?>
then i have a member page that includes the logincheck.php
<?... include("http://www.hazardnet.net/login/logincheck.php"); ...?>
to try for yourself goto my site and try logging in with:
username: guest
password: guest