Create a PHP Login Script 2015(youtube).
hi there, i have some problems with simple login php script.
actually i have problem like this - Notice: Only variables should be passed by reference in D:\X_AMPP\htdocs\www\register.php on line 15.
and my code on that lines (line 15 is - $stmt->bindParam(':password', password_hash($_POST['password'], PASSWORD_BCRYPT)); looks like -
//error_reporting(0);
require 'database.php';
$message = '';
if(!empty($_POST['email']) && !empty($_POST['password'])):
//Enter new user into DB!
$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 crated new user';
else:
$message = 'Sorry there must have been an issue to create an account!';
endif;
endif;
?>
alright my bad , already find the answer below :)
To others finding same issue, the solution is simple to change:
$stmt->bindParam(':email', $_POST['email']);
$stmt->bindParam(':password', password_hash($_POST['password'], PASSWORD_BCRYPT));
to
$email = $_POST['email'];
$password = password_hash($_POST['password'], PASSWORD_BCRYPT);
<p>$stmt->bindParam(':email', $email);
$stmt->bindParam(':password', $password);
Login scripts will always be really had to create from the different parts of the page in the You Tube channels. If problem from the references on the superiorpapers com website only be compact then register will be need only password and username.
I read that Post and got it fine and informative. Please share more like that...Great Article it it's really informative and innovative keep here: Quality web design & development services london with new updates. Its was really valuable. Thanks a lot.