0

have made a simple dynamic login page.you have to enter username and password in order to view data.I have pasted the code below and the screenshot of error.code in config.php is the connection made with database.name of db is department and tablename is user.

   if($_POST)
   { 
    $unam=$_POST["uname"];
    $pwd=$_POST["pwd"];
    include ("config.php");

    $res=mysqli_query($con,"select * from user where uname=$unam AND password=$pwd ");
    $row=mysqli_fetch_array($res);

    //also tried
    //while($row=mysqli_fetch_array($res);
    if($res){ ?> <a href="list.php">Click here to view</a><?php } 
    else { ?> login failed <?php }
    }
Machine
  • 103
  • 7

0 Answers0