19
rated 0 times
[
23]
[
4]
/ answers: 1 / hits: 5819
/ 10 Years ago, wed, december 31, 2014, 12:00:00
this is my controller function
public function verifyUser()
{
$userName = $_POST['email'];
$userPassword = $_POST['password'];
$var=array('email'=>$userName,'password'=>$userPassword);
$check=$this->mymodel->login_validation($var);
//$status = array(STATUS=>false);
if(count($check))
{
redirect('main/valid_login');
}
else
{
echo <div style='border:1px solid red;font-size: 11px;margin:0 auto !important;'>Could't Authorize to the system! Try again with valid credentials.</div> ;
}
}
this is my ajax function
<script>
function makeAjaxCall(){
$.ajax({
type: post,
url: <?php echo site_url('main/verifyUser');?>,
cache: false,
data: $('#userForm').serialize(),
success:function(msg)
{
$('#show_id').html(msg);
}
});
}
</script>
this is my form
<form name=userForm id=userForm action=>
<div id=show_id></div>
<fieldset>
<p><label for=email>E-mail address</label></p>
<p><input type=email id=email placeholder=enter your email id name=email></p> <!-- JS because of IE support; better: [email protected] -->
<p><label for=password>Password</label></p>
<p><input type=password id=password placeholder=******* name=password style=width: 328px;></p> <!-- JS because of IE support; better: placeholder=password -->
<p><input type=button value=Sign In onclick=javascript:makeAjaxCall();></p>
</fieldset>
</form>
everything is working fine,but when i entered the valid username and password,its not redirecting to any page,so please help me on this
More From » php