I am trying to figure out how to pass my form var's to anothe page..
var login = $('#login').val();
var pass = $('#pass').val();
var data = {
login: login,
pass: pass
};
$.ajax({
type: "POST",
data: data,
url: "page_2.php",
success: function(data)
{
document.location.href = url;
}
});
It doesn't post to the new page at all.. In page_2.php I have:
<?php
$error = false;
if (isset($_REQUEST))
{
extract($_REQUEST);
print_r($_REQUEST);
}
// else
// {
// header("location:page_1.php");
// }
?>
I've searched google for 2 days with no luck on examples of posting var's to another page via jquery/ajax/php.. Can anyone help or point me to a link that can?
Thanks so much!