Advertisement
Guest User

Untitled

a guest
Jun 13th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1.  
  2. <?php
  3. session_start();
  4.  
  5. if (isset($_POST['username'])) {
  6.  
  7. // Include the databas connection script
  8. include_once("dbconnect.php");
  9.  
  10. // Set the posted data from the form into local variables
  11. $usname = strip_tags($_POST['username']);
  12. $paswd = strip_tags($_POST['password']);
  13.  
  14. $usname = mysqli_real_escape_string($dbCon, $usname);
  15. $paswd = mysqli_real_escape_string($dbCon, $paswd);
  16.  
  17. $paswd = md5($paswd); // using md5 just for testing purposes
  18.  
  19. $sql = "SELECT username, password FROM users WHERE username = '$usname' AND activated = '1' LIMIT 1";
  20. $query = mysqli_query($dbCon, $sql);
  21. $row = mysqli_fetch_row($query);
  22. $uid = $row[0];
  23. $dbUsname = $row[1];
  24. $dbPassword = $row[2];
  25.  
  26. // Check if the username and the password they entered was correct
  27. if ($usname == $dbUsname && $paswd == $dbPassword) {
  28. // Set session
  29. $_SESSION['username'] = $usname;
  30. $_SESSION['password'] = $uid;
  31. // Now direct to users feed
  32. header("Location: site.php");
  33. } else {
  34. echo "<h2><center>הפרטים שהזנת הנם שגויים, אנא נסה שנית.
  35. <br />
  36. </center></h2>";
  37. }
  38.  
  39. }
  40. ?>
  41.  
  42.  
  43.  
  44.  
  45.  
  46. <html lang="he">
  47. <body background="https://srv214.gif.co.il/images/79713274H.jpg" dir="rtl">
  48. <title>התחברות</title>
  49. <center>
  50. <a href="http://mworld.pe.hu/index.php">
  51. <img src="https://srv214.gif.co.il/images/368053logo.png"></img></a>
  52.  
  53. <font face="arial" style="color: black;
  54. -webkit-text-fill-color: white;
  55. -webkit-text-stroke-width: 2px;
  56. -webkit-text-stroke-color: DarkRed";>
  57.  
  58. <h1>משחק דפדפן ישראלי בחינם</h1></font>
  59.  
  60. <font face="segoe ui" size=6>
  61. <br /><p><p>
  62.  
  63. <table border="5" style="border-style: solid";>
  64. <td>
  65. <center>
  66.  
  67. <form id="form" action="index.php" method="post" enctype="multipart/form-data">
  68. &nbsp;<font size=5>
  69. &nbsp;שם המשתמש:<input type="text" name="username">
  70. <br />
  71. &nbsp;&nbsp;&nbsp;סיסמת כניסה:<input type="password" name="password">
  72. <br /><br />
  73. <input type="submit" name="button1" value="התחברות לאתר" style="background-color: #4CAF50; /* Green */
  74. border: none;
  75. color: white;
  76. padding: 15px 32px;
  77. text-align: center;
  78. text-decoration: none;
  79. display: inline-block;
  80. box-shadow: 3px 3px 3px #888888;
  81. font-size: 16px;">
  82.  
  83.  
  84. </form>
  85. <a href="http://mworld.pe.hu/sign%20up.php" style="text-decoration:none";><h5>הירשם בחינם</h5></a>
  86. </td>
  87. </font>
  88. </table>
  89.  
  90.  
  91.  
  92.  
  93. </center>
  94. </html>
  95. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement