Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
php mysql programming issue for login page

After clicking on the login button it remains on the same page and it does not give nay output for example:if i put in a wrong userid or password it should echo something but it does not echo anything and stays the same the code for LOGIN.PHP FILE is:

<!DOCTYPE html>    
<html>    
<head>    
<meta charset="utf-8">       
<title>title of the document</title>   


    <link rel="stylesheet" type="text/css" href="style.css">
   </head>
   <body>
      <form action"signin.php" method="POST">
        <input type="text" name="uid" placeholder="Username"><br>
        <input type="password" name="password" placeholder="PAssword"><br>
        <button type="submit">SIGN IN</button><br>
      </form>
      <br><br><br><br>
      <form action="signup1.php" method="POST">
        <input type="text" name="firstname" placeholder="Firstname"><br>
        <input type="text" name="lastname" placeholder="Lastname"><br>
        <input type="text" name="uid" placeholder="Username"><br>
        <input type="password" name="password" placeholder="PAssword"><br>
        <button type="submit">SIGN UP</button><br>
        </form>
      </body>
     </html>

the signin.php file is:

<?php
   include 'dbh1.php';
    $userid=$_POST['uid'];
    $pwd=$_POST['password'];
    $sql="select * from userlogin where uid='$userid' AND password='$pwd'";
    $result = $conn->query($sql);
   if (!$row = $result->fetch_assoc())
    {
      echo "YOU ARE NOT LOGGED IN INCORRECT CREDENTIALS!!";
    }
    else {
      echo "SUCCESFULLY LOGGED IN!!";
    }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I have tried this and it is working. Here learn prepared statements

<form action"signin.php" method="POST">
    <input type="text" name="uid" placeholder="Username"><br>
    <input type="password" name="password" placeholder="PAssword"><br>
    <input type="submit" value="Sign In" />
</form>

<?php
    include 'database.php';
    $userid=$_POST['uid'];
    $pwd=$_POST['password'];
    $stmt = $conn->prepare("select * from userlogin where uid=? AND password=?");
    $stmt->bind_param("ss",$userid, $pwd);
    $stmt->execute();
    $result = $stmt->get_result();
    $row = $result->fetch_assoc();
    $stmt->close();

With prepared statements you have achieved a lot of things. Just try to check it.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!