Reputation: 5821
i use this code :
$(document).ready(function() {
$.ajax({
url: 'server.php',
type: 'POST',
data : {temp : '100'},
success: function(data) {
alert('Load was performed.');
}
});
});
and just want to take the value of temp at the server.php file and print it , what im doing is $_POST['temp']; but dont have results
Upvotes: 1
Views: 77
Reputation: 2877
Try this
$(document).ready(function() {
$.ajax({
url: 'server.php',
type: 'POST',
data : "temp=100",
success: function(data) {
alert('Load was performed.');
}
});
});
Upvotes: 0
Reputation: 163288
On the PHP end, you need to actually output that by passing it to echo:
echo $_POST['temp'];
Upvotes: 1