How to pass var's to another page using jquery & php

noister

New Member
I am trying to figure out how to pass my form var's to anothe page..\[code\]var login = $('#login').val();var pass = $('#pass').val();var data = http://stackoverflow.com/questions/3897795/{ login: login, pass: pass};$.ajax({ type:"POST", data: data, url: "page_2.php", success: function(data) { document.location.href = http://stackoverflow.com/questions/3897795/url; }}); \[/code\]It doesn't post to the new page at all.. In page_2.php I have:\[code\]<?php $error = false; if (isset($_REQUEST)) { extract($_REQUEST); print_r($_REQUEST); }// else// {// header("location:page_1.php");// }?>\[/code\]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!
 
Back
Top