Ferry recovery
-
Comment, please.
//Выводим все ошибки error_reporting(E_ALL);
//Имя базы
$table = 'users';//Коннектимся в базе
mysql_connect("localhost", "root") or die("Error connect to server");
mysql_select_db("aaa") or die("Error select db");if (isset($_POST['ok'])) {
$email = !empty($_POST['email']) ? trim($_POST['email']) : NULL;
$sql = mysql_query("SELECTemail
FROM " . $table . " WHEREemail
= '" . mysql_real_escape_string($email) . "'");
if (mysql_num_rows($sql) < 1)
echo 'Такого мыла нет';
else {
$row = mysql_fetch_assoc($sql);
$to = $row["email"];
$from = 'admin@mail.ru';
$tema = "=?utf-8?b?" . base64_encode("Восстановление пароля") . "?=";
$header = "Content-type:text/html; charset="windows-1251"\n";
$header .= "From: <" . $from . ">\n";
$header .= "MIME-Version: 1.0\n";
$msg = "Для создания нового пароля кликните по ссылку <a href="">Задать новый пароль</a>";
$mail = mail($to, $tema, $msg, $header);
if ($mail !== FALSE)
echo '<p>Иди на мыло и кликай по ссылке</p>';
}
}
-
What's the link going on? The table must have a flag that the laser is asking for re-establishment of the password, so he needs to record something. a.
$msg = "Для создания нового пароля кликните по ссылку <a href=\"\">Задать новый пароль</a>";
You can find the soap of the nover, just stupidly walk through any such reference, change the password, change the soap and the acques of yours.
What checks and how will the reference to the mail be?