Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

180
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda