$('.form-control[name=promo]').on('keyup', function() {
var nac_price = $('.complete:not(#complete2)').text().split(' ');
var old_price = parseInt(nac_price[1]);
var text = $('.form-control[name=promo]').val();
var codes = ["PROMO", "PROMO2"];
if ($.inArray(text, codes) != "-1") {
var priceP = parseInt(nac_price[1]);
var promo_new_price = priceP - 500;
$('.complete:not(#complete2)').text("Цена: " + promo_new_price + " руб.")
$('.form-control[name=promo]').off();
}
})
$ack = mysqli_query($connection, "SELECT * FROM `users` WHERE `email` = '$p_login'");
<?php
require '../libs/bd.php';
require '../libs/session.php';
$date = $_POST;
$errors = [];
if (isset($date['log_b'])) {
if ($date['login'] == "") {
$errors[] = 'Ошибка: Вы не ввели логин!';
} else {
$p_login = $date['login'];
$ack = mysqli_query($connection, "SELECT * FROM `users` WHERE email = '$p_login'");
$user = mysqli_fetch_assoc($ack);
}
if ($date['pass'] == "") {
$errors[] = 'Ошибка: Вы не ввели пароль!';
} else {
$passh = password_verify($date['pass'], $user['password']);
}
if ($passh == false) {
$errors[] = 'Ошибка: Вы ввели не верный логин или пароль!';
}
if (empty($errors)) {
$id = $user['id'];
$_SESSION['Auth'] = $id;
setcookie("Auth", $id, time()+60*60*24*365*100 , "/");
echo "Успешно";
} else {
echo array_shift($errors);
}
}
?>
session_start();
if (isset($_SESSION['Auth'])) {
$id = $_SESSION['Auth'];
$ack = mysqli_query($connection, "SELECT * FROM `users` WHERE id = $id");
$user = mysqli_fetch_assoc($ack);
} elseif (isset($_COOKIE['Auth'])) {
$_SESSION['Auth'] = $_COOKIE['Auth'];
header("Refresh: 0");
}
?>
Но корнем считается ip адрес хотя корень это папка project