我正在按照創建註冊和登錄系統的教程。我盡一切努力,但當我按下提交表單時,仍然出現奇怪的嚴格標準錯誤。嚴格的標準錯誤,同時保存註冊數據
<?php
require 'pdoconnect.php';
$message = '';
if(!empty($_POST['email']) && !empty($_POST['password'])):
// Enter the new user in the database
$sql = "INSERT INTO users (email, password) VALUES (:email, :password)";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':email', $_POST['email']);
$stmt->bindParam(':password', password_hash($_POST['password'], PASSWORD_BCRYPT));
if($stmt->execute()):
$message = 'Successfully created new user';
else:
$message = 'Sorry there must have been an issue creating your account';
endif;
endif;
?>
它說
嚴格的標準:只有變量應該通過線14(與密碼哈希線)引用傳遞。
我已經找遍瞭解決方案,但我無法找到任何。
在使用'bindParam()'中的散列值之前,您應該對密碼*進行散列* –