Monday, 26 August 2013

Jquery $.post Issue

Jquery $.post Issue

I want to my post data to login.php page. But problem is $.post() not
working. tell me the error of this code.
/includes/login.page (this one is a lightbox)
<form id="forgot-username-form" method="get" >
<label id="email">Forgotten your username ?</label>
<input type="email" name="forgot_username"
id="user-email" />
<input type="submit" name="forgot_username"
value="Send"/>
</form>
/script/username.js
$(document).ready(function(){
$("#forgot-username-form").submit(function() {
var email = $("#user-email").val();
alert(email);
$.post("login.php",{email:email},function(result){
alert(result);
});
});
});
/login.php
if(isset($_GET['email'])){
$email = $_GET['email'];
echo $email;
}
help me to find a error of this code.

No comments:

Post a Comment