Retrieving the data with PHP, I cannot use $_POST
; but $_GET
. Why? Am I sending my form data incorrectly?
I'd have thought request.open("POST"
would process the form as a POST and not GET? How may I sent it as a POST?
var request = new XMLHttpRequest();
request.open("POST","email.php?text=" + textarea.value + "&email=" + email.value, true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
var resp = request.responseText;
console.log(resp);
}
};
request.send();