0
error referring to the same line of code :
$stmt->bindParam(':Password', password_hash($_POST ['Password'], PASSWORD_BCRYPT));
Who Accumulate and record the information entered in the form with the following line
<input type="Password" placeholder="Password" name="Password">
Password Field is also correctly closed with "P" in Mysql.
Full block :
if(!empty ($_POST['Username']) && !empty($_POST['Password']));
$sql ="INSERT INTO users (Username,Password) values (:Username, :Password)";
$stmt= $conn->prepare ($sql);
$stmt->bindParam (':Username', $_POST['Username']);
$stmt->bindValue(':Password', password_hash($_POST ['Password'], PASSWORD_BCRYPT));
if ($stmt-> execute() ):
die('success');
else: ................
Help please ?
about the password, edit and put the query. But the error is clear, no Password name bind replacement has been defined in it.
– Bacco
see also: http://answall.com/questions/88400/70
– Bacco
replace "param" with "value" solved the second error. In fact I don’t see what could be causing that error, I have lines of identity code that are working fine. the Password field is not only closed with pass instead of text, it has the hash . is the only difference..
– Mr_sang
Is that PDO or mysqli? PDO has :named, mysqli does not.
– Bacco
PDO. updated the code above
– Mr_sang
Separate the contents with something like this:
$hash = password_hash($_POST ['Password'], PASSWORD_BCRYPT);
and then$stmt->bindValue(':Password', $hash );
– Bacco
Didn’t work =\
– Mr_sang