I am using this function:
function end_incident() {
var dataString = 'name=Daniel&phone=01234123456';
$.ajax({
type: "POST",
url: "http://www.example.co.uk/erc/end_incident.php",
data: dataString,
success: function(msg){
alert('Success!'+dataString);
}
});
};
to send information to end_incident.php, but I’m not able to access the $_POST variables. I’ve tried doing it like this:
$name = $_POST['name'];
$phone = $_POST['phone'];
Am I doing something wrong?
Thanks for any help
Try sending the data as an object: