I am running this on my local:
<script>
$(document).ready(function() {
$("#validateButton").click(function() {
var forename = $("#Name").val();
var surname = $("#Surname").val();
var dob = $("#DOB").val();
var flatNumber = $("#FlatNumber").val();
var houseName = $("#HouseName").val();
var houseNumber = $("#HouseNumber").val();
var street = $("#Street").val();
var townCity = $("#TownCity").val();
var county = $("#County").val();
var postcode = $("#Postcode").val();
var sortcode = $("#AccountSortCode").val();
var accountNumber = $("#AccountNumber").val();
var parameters = {forename:forename, surname:surname, dob:dob, flatNumber:flatNumber, houseName:houseName, houseNumber:houseNumber, street:street, townCity:townCity, county:county, postcode:postcode, sortcode:sortcode, accountNumber:accountNumber};
$.post("Validate.php", parameters, function(result) {
$.each(result, function(key, value) {
alert(key);
if (key == 'AuthenticationDecision') { $("#validationResult").html(value) };
});
});
});
});
</script>
which brings in this array from the php script:
{"AuthenticationDecision":"Not Authenticated","NameScore":0,"AddressScore":0}
and runs as expected.
When I try to run the same thing on the host server, alert(key) just returns 0,1,2,3,... until I stop it.
If I run the validate.php script on its own on the host it outputs the data just fine.
If I don't post the data and just hardcode it in the validate.php, the result is also wrong, once I click the id.
I assume the issue is when the result is actually returned if it is returned at all.
Does anyone know of any reason why I might be getting this behaviour?
Thanks for any help offered.