it would be like this?... 😕
<?php
session_start();
session_register("anyname") ; //Register Session
$dbuser = 'dbusernamehere';
$dbpass = 'dbpasswordhere';
$username = $_POST['username'];
$passwd = $_POST['passwd'];
//connect to the DB and select the database
$connection = mysql_connect('localhost', $dbuser, $dbpass) or die(mysql_error());
mysql_select_db('biohazard_login', $connection) or die(mysql_error());
//set up the query
$query = "SELECT * FROM biohazard_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) {
print "Thank your for logging in, $username,Please continue into the <a href=\"members.php\">members area</a>";
}
else {
print 'Sorry, you seem to have entered an incorrect Username/Password.';
}
?>
like that? 🙁 sorry i dont know much about sessions.