
Originally Posted by
cpradio
Hi cpradio, I am having problem on this after i successfully registered,I have no idea how can i verify the password when i am going to log-in.can you help me please
Code:
include_once("connectiondb.php");
if(isset($_GET['register']))
{
$username = $_GET['user'];
$password = $_GET['pass'];
$firstname = $_GET['fname'];
$lastname = $_GET['lname'];
$salt1="******************";
$salt2="*******************";
try{
$sql = "INSERT INTO reg (username,password,firstname,lastname)
values(?,?,?,?,?,?)";
$cmd = $db->prepare($sql);
$cmd ->execute(array($username,hash('sha256',$salt1.$password.$salt2),$firstname,$lastname));
echo "success";
$db = null;
}
catch(PDOException $e)
{
echo $e->getMessage();
}
}
Bookmarks