I have a problem. Early I use PHP 5.3 in my project and all Ajax post requests works great, but now when I migrate on PHP 7 all this request are not working. How to solve this problem.
$.post
(
'http://test.atk/php/get_list.php',
{
list_item: list_item
},
function(list_data){
alert(list_data);
console.log(list_data);
$("list").html(list_data);
}
);
It`s return empty. In PHP I have:
<?php
session_start();
$user_id = $_SESSION['user_id'];
include_once "db.php";
$list_item = $_POST['list_item'];
$user_list = $conn->prepare("SELECT * FROM list WHERE user_id = :user_id AND list_id = :list_id");
$user_list -> bindValue(":user_id" , $user_id);
$user_list -> bindValue("::list_id" , $list_item);
$user_list -> execute() ?>
And error_log and firebug gives me the next message:
Notice: Undefined index: list_item in X:\home\test.atk\www\php\get_list.php on line 6
I think the problem in new PHP 7, may be it has new syntax for ajax variebles? Help me if know how.