Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once('inc/db.php'); ?>
- <?php
- session_start();
- if (isset($_POST['submit'])) {
- $username = htmlspecialchars(trim($_POST['username']));
- $password = htmlspecialchars(trim($_POST['password']));
- if ($username&&$password) {
- $password = md5($password);
- mysql_connect('localhost','root','root');
- mysql_select_db(strbdd);
- $log = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
- $rows = mysql_num_rows($log);
- if ($rows==1) {
- $_SESSION['username']=$username;
- header('Location:index.php');
- }else {echo "Nom d'utilisateur ou mot de passe incorrect";}
- }else { echo "Veuillez saisir tout les champs";}
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Connexion - Stressing-Network</title>
- <link rel="stylesheet" href="css/style.css">
- <script src="js/index.js"></script>
- <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'>
- <link rel='stylesheet prefetch' href='http://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900&subset=latin,latin-ext'>
- </head>
- <body>
- <div class="materialContainer">
- <div class="box">
- <div class="title">LOGIN</div>
- <form method="POST" action="login.php">
- <div class="input">
- <p>pseudo</p>
- <input type="text" name="username">
- <span class="spin"></span>
- </div>
- <div class="input">
- <p>votre mot de passe</p>
- <input type="password" name="password"><br/><br/>
- <span class="spin"></span>
- </div>
- <div class="button login">
- <input type="submit" name="submit" value="se connecter">
- </div>
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement