Answer the question
In order to leave comments, you need to log in
Why doesn't the password change function work?
I can't figure out what's wrong here, when I enter static data for example: "SET `password` = '123' " everything changes, and when I try to display data from the form, nothing changes (Here is the code:
<?php
$password = $_POST['password'];
$login = $_POST['login'];
$mysqli = new mysqli("localhost","root","","registration3")or die("Нет соединения: " . mysql_error());
print ("Удачно соединено");;
$mysqli->query("SET NAMES 'utf8' ");
//$result = mysql_query ("UPDATE `users` SET `password` = $password WHERE `users`.`login` = $login;");
$result = $mysqli->query("UPDATE `users` SET `password` = '$password' WHERE `users`.`login` = '$login';");
$mysqli->close();
?>
<a href="index.php" style="color:blue" >Назад</a>
<h1>Восстановление пароля</h1>
<form action="change.php" method="POST" >
<input type="text" name="login" placeholder="Введите логин" >
<input type="password" name="password" placeholder="Введите пароль" >
<button type="submit" name="do_change">Отправить</button>
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question