I have this Jquery Javascript code:
$(document).ready(function(){
$("#check_button").click(function(){
$.ajax({
url: "includes/adcontent.php",
type: "GET",
data: "id=<?php echo $id; ?>",
async: false,
cache: false,
beforeSend: function (data) {
$('#check_quest_button_div').html("<img src='/images/icons/loading.gif' title='Please wait' alt='Please wait' />");
}
});
});
});
And this is my PHP code in includes/adcontent.php:
if (!isset($id) && isset($_GET['id'])){
$id=htmlspecialchars(strip_tags($_GET['id']));
}
echo $id;
But with this code I have an error message. The script doesnt send the GET data. What is the problem?