I am posting a form with the following:
if ( flag ) {
jQuery.ajax({
url: 'submit_licence.php',
dataType: 'json',
type: 'POST',
data: 'flag=' + flag + '®ion=' + jQuery('#licenceRegion').val() + '&lnum=' + jQuery('#enterLicence').val() + '&fname=' + jQuery('#fname').val() + '&lname=' + jQuery('#lname').val(),
success: function( data ) {
}
});
}
The HTML
<input class="buttondb4 white2 large" type="text" value=" " id="enterLicence" />
<input type="hidden" name="licenceRegion" id="licenceRegion" value="" />
<input type="hidden" name="fname" id="fname" value="First" />
<input type="hidden" name="lname" id="lname" value="Last" />
and my PHP:
if ($_POST){
$lnum = noescape($_POST['lnum']);
$fname = noescape($_POST['fname']);
$lname = noescape($_POST['lname']);
$region = noescape($_POST['region']);
$flag = noescape($_POST['flag']);
//mysql query here
}
But when its posted, it is not retrieving any of the posted data (the posted values are blank)
Why is it not pulling the data? What am I missing? What have I done wrong?
Unfortunately I cannot post the entire script/page due to it being a private project for a client although I think I have provided enough information for what I am trying to do.