I get an error in line 48. I have the following code:

<?php include("connectbd.php"); if (!empty($_POST)) { $email = mysql_real_escape_string($_POST['email']); $email = trim($email); // проверяем, если юзер в таблице с таким же мылом $query = "SELECT name, email, password FROM `users` WHERE email ='{$email}' UNION ALL SELECT name, email, password FROM `sense` WHERE email ='{$email}'"; $sql = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($sql) == 1) { //если есть $name = $row[name]; $email = $row[email]; $password = $row[password]; $message = 'У вас новое сообщение, напоминаем ваш пароль: ' . $password . ''; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8 \r\n"; # /* дополнительные шапки */ $headers .= "To: $name <$email>" . "\r\n"; $headers .= "From: iExtrasense.com <ie***nse@gmail.com>\r\n"; $subject = "Здравствуйте, $name! Напоминание пароля."; # # /* и теперь отправим из */ mail($email, "=?utf-8?B?" . base64_encode($subject) . "?=", $message, $headers); echo '<center><h2>Пароль отправлен на Ваш Email!</h2></center> '; } else { echo '<center><h2>Не зарегистрированный или не правильный Email!</h2></center>'; } } ?> 
  • 2
    there are generally lines of less than 48 ... You'd rather have the content of the error itself displayed. - Smash
  • @Maris, even for interest, he himself counted =))). I did not understand where the error on line 48 on the screenshot. - Node_pro

2 answers 2

At the very bottom before?> Put}, now the condition if (! Empty ($ _ POST)) has an opening bracket, but there is no closing bracket, hence the error.

Judging by the screenshots, you have entered the wrong password when connecting to the database. Check it out! By the way, Vigilant correctly noted, you have not closed}.
The PS function that is responsible for connecting to the database is called mysql_connect ().

  • Here I am about the same. - Smash
  • I entered the password correctly! - Sasha Osipov
  • means the username is incorrect =) - Node_pro
  • Is logical. :) - Smash
  • And if from the console MySQL go under your data, go? - Smash