blink10
asked on
trouble with my ajax request....
i have isolated problem down to these lines of code:
its does send anything to comphp.php
its does send anything to comphp.php
var age = document.getElementById('productid').value;
var wpm = document.getElementById('memberid').value;
var sex = document.getElementById('message').value;
var parameters = "age=" + age + "&wpm=" + wpm + "&sex=" + sex;
mypostrequest.open("POST", "comphp.php", true);
mypostrequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
mypostrequest.send(parameters);
ASKER
http://www.billsprice.com/com.php
If it works the message at the bottom will change, its not my php either...it worked fine with get and the php file is only printing the number 1 if it works..
If it works the message at the bottom will change, its not my php either...it worked fine with get and the php file is only printing the number 1 if it works..
replace :
xmlhttp.open("POST","comphp.php", true);
by :
ajaxRequest.open("POST","comphp.php", true);
xmlhttp.open("POST","comphp.php",
by :
ajaxRequest.open("POST","comphp.php",
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok why doesnt $pi = $_POST['pi']; pick up the parameters i sent?
you miss : ajaxRequest.setRequestHead er("Conten t-type", "application/x-www-form-ur lencoded") ;
ASKER
opps forgot to set headers, it works now, thanks.
... you missed
please provide a link to see your page in live