// place a username and password input field on the page
<input type=text id="username">
<input type=password id="pass">
// call a server-based PHP file that will process the information passed to it
$.post("myFormProcessor.php", {username: $("#username").val(),
password: $("#pass").val()});
// conversely, this PHP file could also return information to the function, from which
// you could process the results
$.post("myFormProcessor.php", {username: $("#username").val(),
password: $("#pass").val()},
function(data){
// the data variable contains the text returned from the server, you don't
// have to set anything up ahead of time, jQuery will do it all for you
if (data != "ERROR")
$("#responseDiv").text(data);
}
);