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
- $row = $dbCon->query("SELECT username, password FROM users WHERE username = '".$usname."' AND password = '".$paswd."'LIMIT 1")->fetch_array(MYSQLI_BOTH);
- if(!isset($row)) {
- echo "<h2><center>הפרטים שהזנת הנם שגויים, אנא נסה שנית.
- <br />
- </center></h2>";
- header("Location: /");
- }else {
- $uid = $row[0];
- $dbUsname = $row[1];
- $dbPassword = $row[2];
- header("Location: site.php");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement