Test Case Boilerplate
Fork this way...
HTML
<html>
<body>
<form id = 'login_form' action = '' method = 'post'>
<label>Email: </label><input type = 'text' name = 'email' value = '[email protected]'/>
<label>Pass: </label><input type = 'password' name = 'pass' value = 'chinhdung'/>
<input type = 'submit' value = 'Login'/>
</form>
<div class = 'login_result'></div>
</body>
</html>
JavaScript
$(document).ready(function(){
$('#login_form').submit(function(){
alert(($(this).serialize()));
$.post('link.php', $(this).serialize(), function(data){
$('.login_result').html(data);
});
});
});
<?php
//file link.php
//don't echo array value with email: [email protected] and pass: chinhdung
if($_GET){
print_r($_GET);
}
?>