I have a PHP page with $_POST
and $_FILES
data filled in. The POST data was obtained not from a traditional HTML form, but between multiple pages.
For example, the POST data is a number of things:
$_POST["username"]
$_POST["password"]
$_FILES
etc.
The question is, how do I send this POST data off to an AJAX call within the page?
I know with a form it's something like this:
$.ajax({
type: 'post',
url: 'post.php',
data: $('form').serialize(),
success: function () {
alert('form was submitted');
}
});
But what about directly from PHP's POST data?