Fireboard Admin System
User Login
E-Mail
:
Password
:
session_start(); if($_SESSION['user']!=''){header("Location:home.php");} include("config.php"); $email=$_POST['mail']; $password=$_POST['pass']; if(isset($_POST) && $email!='' && $password!=''){ $sql=$dbh->prepare("SELECT * FROM users WHERE username=?"); $sql->execute(array($email)); while($r=$sql->fetch()){ $p=$r['password']; $p_salt=$r['psalt']; $id=$r['id']; } $site_salt="firesaltsplodgecode";/*Common Salt used for password storing on site. You can't change it. If you want to change it, change it when you register a user.*/ $salted_hash = hash('sha256',$password.$site_salt.$p_salt); if($p==$salted_hash){ $_SESSION['user']=$id; header("Location:home.php"); }else{ echo "
Username/Password is Incorrect.
"; } } ?>