我正在练习为网站构建PHP注册表单脚本。我已经完成了这个代码,但是当我点击提交按钮时,我得到了通知:只有变量应该在第13行中通过引用传递,并且我坚持要在这里做什么。任何帮助非常感谢,再次我不是一个PHP专家。只有变量应通过引用传递...在线13失败
<?php
require 'database.php';
if(!empty($_POST['email']) && !empty($_POST['username']) && !empty($_POST['password'])):
//Enter the new user into the database
$sql = "INSERT INTO users (email, username, password) VALUES (:email, :username, :password)";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':email', $_POST['email']);
$stmt->bindParam(':username', $_POST['username']);
$stmt->bindParam(':password', password_hash($_POST['password'], PASSWORD_BCRYPT));
if($stmt->execute()):
die('Success');
else:
die('Fail');
endif;
endif;
?>
这里
当你得到PHP错误很好的参考http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php – Terminus