выдает ошибкуarse error: syntax error, unexpected variable "$result" in C:\OSPanel\domains\12.loc\auth.php on line 10
php код:
<?php
$login = filter_var(trim($_POST['login']), FILTER_SANITIZE_STRING);
$pass = filter_var(trim($_POST['pass']), FILTER_SANITIZE_STRING);
$name = filter_var(trim($_POST['name']), FILTER_SANITIZE_STRING);
$pass = md5($pass."---"
$mysql = new mysqli('localhost', 'root', '---', '---'
$result = $mysql->query("SELECT * FROM 'users' WHERE 'login' = '$login' AND 'pass' = '$pass'"
$user = $result->fetch_assoc();
if(count($user) == 0){
echo "Такой пользователь не найден"
exit();
}
setcookie('user', $user['name'])
$mysql->close();
header('location: /'
?>
php код:
<?php
$login = filter_var(trim($_POST['login']), FILTER_SANITIZE_STRING);
$pass = filter_var(trim($_POST['pass']), FILTER_SANITIZE_STRING);
$name = filter_var(trim($_POST['name']), FILTER_SANITIZE_STRING);
$pass = md5($pass."---"
$mysql = new mysqli('localhost', 'root', '---', '---'
$result = $mysql->query("SELECT * FROM 'users' WHERE 'login' = '$login' AND 'pass' = '$pass'"
$user = $result->fetch_assoc();
if(count($user) == 0){
echo "Такой пользователь не найден"
exit();
}
setcookie('user', $user['name'])
$mysql->close();
header('location: /'
?>