i have a simple form in php that has a user textbox and pass textbox we'll call it login.php. I have another php page, let's call it sendtologin.php, that i want to 'send' the credentials via jquery ajax to post to login.php. The login.php is on server1 and sendtologin.php is on server2. when i try to load the sendtologin.php i get a status code of 0 and error. here is my script.
$(document).ready(function () {
$.ajax({
type: "POST",
url: "http://server1/login.cgi",
data: { lang_changed: "no", username: "me", password: "me" },
success: function (data) { alert("success!"); },
error: function (request, type, errorThrown) {
alert("request: " + request.status +
"
requestText: " + request.statusText +
"
Type: " + type +
"
Exception: " + errorThrown); }
});
});
what am i doing wrong?