Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. if (isset($_POST['username'])) {
  5.  
  6. include_once("dbfontnnect.php");
  7. $usname = strip_tags($_POST['username']);
  8. $paswd = strip_tags($_POST['password']);
  9.  
  10. $usname = mysqli_real_escape_string($dbCon, $usname);
  11. $paswd = mysqli_real_escape_string($dbCon, $paswd);
  12.  
  13. $paswd = md5($paswd);
  14. $row = $dbCon->query("SELECT username, password FROM co WHERE username = '".$usname."' AND password = '".$paswd."'LIMIT 1")->fetch_array(MYSQLI_BOTH);
  15. if(!isset($row)) {
  16. echo "<h3>הפרטים שהזנת הנם שגויים, אנא נסה שנית.</h3>";
  17.  
  18. }else {
  19. $uid = $row[0];
  20. $dbUsname = $row[1];
  21. $dbPassword = $row[2];
  22. header("Location: home.php");
  23. }
  24.  
  25. }
  26. ?>
  27.  
  28.  
  29.  
  30. <html>
  31. <body background="https://i.imgsafe.org/ed7d8b69c3.jpg">
  32. <center>
  33. <form id="form" action="index.php" method="post" enctype="multipart/form-data">
  34. &nbsp;<font size=12 color=white face=alef>
  35.  
  36. <br />
  37. <br />
  38. <br />
  39. <br />
  40. username:<input type="text" name="username">
  41. <br />
  42. password:<input type="password" name="password">
  43. <br />
  44. <input type="submit" name="button1" value="Log in" style="background-color: c61f3b; /* Green */
  45. border: none;
  46. color: white;
  47. padding: 20px 34px;
  48. text-align: center;
  49. text-decoration: none;
  50. display: inline-block;
  51. font-size: 25px;"> </font>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement