This is driving me mad. I’m passing two variables into a function that posts data to a PHP script and then into a database. Pretty simple stuff but I can get the php name part to pass, it just returns empty. I’ve looked at the $.post notes and everything looks ok:
function postData(phpvar, value) {
$.post('scripts/insert.php', { phpvar: value }, function (data) {
if (data == true) {
alert('yes')
} else {
alert(data)
}
});
}
Any help would be greatly appreciated.
You need to set the name like this…
or like this…
Not sure which you’re after.