Guest User

Untitled

a guest
Oct 23rd, 2017
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>LMA Enterprises</title>
  5. </head>
  6.  
  7. <body>
  8. <center>
  9. <h1>LMA Enterprises</h1>
  10. <a href = "index.html">Home</a>
  11. <a href = "login.php">Login</a>
  12. <a href = "register.php">Register</a>
  13. <a href = "search.php">Search</a>
  14. <br><br><br>
  15. <?php
  16. $host = 'localhost';
  17. $user = 'root';
  18. $pass = '';
  19. $conn = mysql_connect($host, $user, $pass);
  20.  
  21. if(! $conn ) {
  22. die('Could not connect: ' . mysql_error());
  23. }
  24.  
  25. mysql_select_db("lma");
  26.  
  27. $empid = $_POST["empid"];
  28. $pass = $_POST["pass"];
  29.  
  30. $sql = "select * from employee";
  31. $retval = mysql_query($sql, $conn);
  32. $found = false;
  33.  
  34. while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
  35. {
  36. if ($row['empid'] == $empid && $row['pass'] == $pass)
  37. {
  38. echo "<br><u><h2>User Details<h2></u>";
  39. echo "<h3>Name : {$row['empname']}</h3>";
  40. echo "<h3>Department : {$row['dept']}</h3>";
  41. echo "<h3>DOB : {$row['dob']}</h3>";
  42. $found = true;
  43. break;
  44. }
  45. }
  46.  
  47. if (!$found)
  48. echo "<br><br>Invalid username or password";
  49.  
  50. mysql_close($conn);
  51.  
  52. //echo "hello".$_POST["empid"]."<br>";
  53. //echo "Your mail is".$_POST["pass"];
  54. ?>
  55. </center>
  56. </body>
  57. </html>
Add Comment
Please, Sign In to add comment