Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (isset($_POST['username'])) {
- // Include the databas connection script
- include_once("dbconnect.php");
- // Set the posted data from the form into local variables
- $usname = strip_tags($_POST['username']);
- $paswd = strip_tags($_POST['password']);
- $usname = mysqli_real_escape_string($dbCon, $usname);
- $paswd = mysqli_real_escape_string($dbCon, $paswd);
- $paswd = md5($paswd); // using md5 just for testing purposes
- $sql = "SELECT username, password FROM users WHERE username = '$usname' AND activated = '1' LIMIT 1";
- $query = mysqli_query($dbCon, $sql);
- $row = mysqli_fetch_row($query);
- $uid = $row[0];
- $dbUsname = $row[1];
- $dbPassword = $row[2];
- // Check if the username and the password they entered was correct
- if ($usname == $dbUsname && $paswd == $dbPassword) {
- // Set session
- $_SESSION['username'] = $usname;
- $_SESSION['password'] = $uid;
- // Now direct to users feed
- header("Location: site.php");
- } else {
- echo "<h2><center>הפרטים שהזנת הנם שגויים, אנא נסה שנית.
- <br />
- </center></h2>";
- }
- }
- ?>
- <html lang="he">
- <body background="https://srv214.gif.co.il/images/79713274H.jpg" dir="rtl">
- <title>התחברות</title>
- <center>
- <a href="http://mworld.pe.hu/index.php">
- <img src="https://srv214.gif.co.il/images/368053logo.png"></img></a>
- <font face="arial" style="color: black;
- -webkit-text-fill-color: white;
- -webkit-text-stroke-width: 2px;
- -webkit-text-stroke-color: DarkRed";>
- <h1>משחק דפדפן ישראלי בחינם</h1></font>
- <font face="segoe ui" size=6>
- <br /><p><p>
- <table border="5" style="border-style: solid";>
- <td>
- <center>
- <form id="form" action="index.php" method="post" enctype="multipart/form-data">
- <font size=5>
- שם המשתמש:<input type="text" name="username">
- <br />
- סיסמת כניסה:<input type="password" name="password">
- <br /><br />
- <input type="submit" name="button1" value="התחברות לאתר" style="background-color: #4CAF50; /* Green */
- border: none;
- color: white;
- padding: 15px 32px;
- text-align: center;
- text-decoration: none;
- display: inline-block;
- box-shadow: 3px 3px 3px #888888;
- font-size: 16px;">
- </form>
- <a href="http://mworld.pe.hu/sign%20up.php" style="text-decoration:none";><h5>הירשם בחינם</h5></a>
- </td>
- </font>
- </table>
- </center>
- </html>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement