I am stuck in my code, I need to send data from the form to the check.php page and then process it.
This is my code:
The AJAX part:
$(document).ready(function(){
var form=$("#myForm");
$("#smt").click(function(){
$.ajax({
type:"POST",
url:form.attr("action"),
data:form.serialize(),
success: function(response){
console.log(response);
}
});
});
});
The form:
the php part:
$user=$_POST['user'];
$pass=$_POST['pass'];
if($user=="tony")
{
echo "HI ".$user;
}
else
{
echo "I dont know you.";
}