I want to use a PHP variable in AJAX url. How can I achieve this?
my.php
function displayRecords() {
$.ajax({
type: "GET",
url: "http://www.bulksmsgateway.in/sendmessage.php?user=Ami&password=74153&mobile=$number&message=$message&sender=INFORM&type=3",
data: "show="+numRecords+"&pagenum="+pageNum,
cache: false,
beforeSend: function () {
$('#content').html('<img src="loader.gif" alt="" width="24" height="24" style=" padding-left:469px;">');
},
success: function(html) {
$("#results").html( html );
}
});
}
<?php
$message="hi"
$number=8888888888;
?>
Here I want to use these PHP variables in AJAX url
How can I achieve this?