Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include_once('../includes/connection.php');
- if (isset($_SESSION['logged_in'])) {
- //nnmn
- } else {
- if (isset($_POST['username'],$_POST['password'])) { // هنا
- $username = $_POST['username'];
- $password = md5($_POST['password']);
- if (empty($username) && empty($password)) {
- $error = "All fields are required!";
- echo $error;
- } else {
- $query = $pdo->prepare("SELECT * FROM editor WHERE Editor_User_Name = ? AND Editor_Password = ? ");
- $query->bindValue(1, $username);
- $query->bindValue(2, $password);
- $query->exesute();
- $num = $query->rowCount();
- if ($num == 1) {
- $_SESSION['logged_in'] = true;
- header('location: index.php ');
- exit();
- }else {
- $error = "Incorrect details!";
- }
- }
- }
- ?>
- <?php include_once('../includes/header.php'); ?>
- <br /><br />
- <?php if (isset($error)) { ?>
- <small style="color:#aa0000;"><?php echo $error; ?></small>
- <br />
- <?php } ?>
- <form action="index.php" method="post"></form>
- <input type="text" name="username" placeholder="Username" autocomplete="off"/>
- <input type="password" name="password" placeholder="Password" />
- <input input type="submit" value="Login" name="submit" >
- <?php include_once('../includes/footer.php'); ?>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement