Jump to content

Why am I getting no response from my loginizer.php file?


Go to solution Solved by maxxd,

Recommended Posts

I am making a simple login with jQuery ajax but I have a little problem. I get no response from my loginizer.php . 

My login page (index.php) contains the following code.


<form action="loginizer.php"  onsubmit="return submitForm();"  method="post" class="box">

<div id="error" ></div>

 <input id="matNo" name="matNo" class="input is-link is-rounded" type="text" placeholder="e.g. 2015/1/55852EE">
   <input id="password" name="password" class="input is-link is-rounded" type="password" placeholder="********">

 <button type="submit"  id="submit" name="submit" class="button is-link is-small">Login</button></form>



My loginizer php contains the code:



$sql= $conn->prepare("SELECT * FROM  $table WHERE Email=?");
$result = $sql->get_result();
$row = $result->fetch_assoc();
$user= $row['Email'];
$pass = $row['Password'];
$errMsg="Invalid Credentials";
$errMsg1="username doesn't exist";
$successMsg = "successLogin";
if($result->num_rows < 1)

echo json_encode($errMsg1);
elseif($pUser == $user && $pPass !== $pass)
echo json_encode($errMsg);
echo json_encode($successMsg);


Ans lastly myJquery.js file which contains:



function submitForm()

 var userid=$("#matNo").val();
 var pass=$("#password").val();
 if(userid!="" && pass!="")

  $("#submit").html("Please Wait...");

  success:function(response) {



    //alert("Wrong Details");


  alert("All details are required");

 return false;



The issue is that I get blank response . If I also change the url in the jQuery/Ajax code to index.php, it comes back with a response consisting of the html of the index.php. If I remove the dataType: 'json', it's still no response.


Thanks for your help in advance!!!

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.