Passing PHP session variable to AJAX URL
- by user547794
Hello,
I am trying to pass a session variable into an AJAX loaded page. Here is the code I am using:
jQuery(document).ready(function(){
$("#userdetail").click(function() {
$.ajax({
url: "userdetail.php?id=<?php $_SESSION['uid']?>",
success: function(msg){
$("#results").html(msg);
}
});
});
});
This is the HTML URL I had working, not sure how to get this into the AJAX call:
userdetail.php?id=<?php $_SESSION['uid']?>
I should also mention that if I manually pass in the userID it works fine
url: "userdetail.php?id=1",