Monday, April 6, 2009

httpRequest post로 전송하기

paramStr = "s_old_password=" + this_.s_old_password.value + "&s_new_password=" + this_.s_new_password.value + "&s_cfn_password=" + this_.s_cfn_password.value;
httpRequest = getXMLHttpRequest();
httpRequest.onreadystatechange=submit_result; <= 마지막에 () 를 넣지 않은걸 주의해야 한다.
httpRequest.open("POST", "./schange_password_run.php", true);
httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
httpRequest.setRequestHeader("Content-length", paramStr.length);
httpRequest.setRequestHeader("Connection", "close");
httpRequest.send(paramStr);