I need to pass multiple data through ajax, and also should post back it in another page. but my code is not working,
this is my code:
var data = {page_num: page,gender: <?php echo $gender;?>this_year: <?php echo $year;?>};$.ajax({ type: "POST", url: "data.php", data: data, success: function(res) { $("#result").append(res); console.log(res); } });
POST the values(data.php):
echo $page = $_POST['page_num'];echo $gender = $_POST['gender'];echo $fromyear = $_POST['this_year'];
please guys help me. thnx,