Saturday, 24 June 2017

php - How to hash a password field

bought a php software that allows users to build websites. But the guy I paid didn't build a signup form. I'm dangerous enough to do basic coding. But I feel this is past my skill level. The form I created inserts into the mysql database just fine, but it wold let the new users that use this form login because the password field isn't hashing.



HMTL signup form:





Fillout the below to join.




































and the php script:



$con = mysql_connect("localhost","name","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());

}

mysql_select_db("instantw_builder", $con);


$sql="INSERT INTO users (first_name, last_name, username, email, password)
VALUES
('$_POST[first_name]','$_POST[last_name]','$_POST[email]','$_POST[email]','$_POST[password]')";

if (!mysql_query($sql,$con))

{
die('Error: ' . mysql_error());
}
echo "1 record added";

mysql_close($con)
?>


What do I need to do to hash the password field?

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...