i m using 000webhost.com for testing my website... when i was using localhost the form was working properly.. link to the testing website
the errors which it shows are jquery ajax based... i don't think there is any problem in ajax, i think the form is not calling action
form...
<form action="login.php" method="post" id="login">
<input id="email" placeholder="E-mail" type="text" name="em" />
<input id="email" placeholder="Password" type="password" name="pwd"/>
<div class="txt1"><input type="checkbox" name="check" />Keep me logged in |<a href="#"> Forgot Password ?</a></div>
<input type="submit" id="loginButton" value="Login" name="log" />
</form>
login.php page..
<?php
session_start();
include "incfiles/connection.php";
$user_login=$_POST['em'];
$password_login=$_POST['pwd'];
$password_login = md5($password_login);
if(empty($user_login) || empty($password_login))
{
die (retmsg(0,"Please fill Email and Password"));
}
$query = mysqli_query($con,"select * from registration where email='$user_login' and password='$password_login'");
$read = mysqli_num_rows($query);
if(!$read)
{
die (retmsg(0,"Incorrect Email or Password"));
}
else
{
while($row = mysqli_fetch_array($query)){
$id = $row["id"];
}
$_SESSION["id"] = $id;
$_SESSION["user_login"] = $user_login;
$_SESSION["password_login"] = $password_login;
if (isset($_SESSION["user_login"]) && isset($_SESSION["password_login"]))
{echo retmsg(1,"profile.php?id=$id");}
}
function retmsg($status,$txt)
{
return json_encode(array('status' => $status, 'txt' => $txt));
}
?>
Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'root'@'localhost' (using password: NO)... – José M. Pérez Nov 17 '13 at 07:58