$username = stripinput($_POST['username']);
$pass = stripinput($_POST['password']);
$result = dbquery("SELECT * FROM ".DB_MY_TABLE." WHERE active='1' AND username='$username'");
while($data = dbarray($result)) {
$username = $data['username'];
$_SESSION['user'] = $username;
$password = $data['password'];
if(password_verify($pass, $password)) {
$_SESSION['valid'] === true;
}
}
}
redirect(BASEDIR."my_dir/my_file.php");
}
if(isset($_POST['username']) && !empty($_POST['email']) && !empty($_POST['password'])) {
$username = stripinput($_POST['username']);
$email = stripinput($_POST['email']);
$password = stripinput($_POST['password']);
$hash = password_hash($password, PASSWORD_DEFAULT);
$reg_time = date("Y-m-d");
$active = 1;
$result = dbquery("INSERT INTO ".DB_MY_TABLE." (acct_id, username, email, password, reg_time, active) VALUES ('', '$username', '$email', '$hash', '$reg_time', '$active')");
$_SESSION['valid'] === false;
}
redirect(BASEDIR."my_dir/login.php");
}
Category Forum
Modifications and Requests - 9Labels
Statistics
2 participants
Notifications
You are not receiving notifications from this thread.
Related Questions