Advertisement
Guest User

Untitled

a guest
Mar 25th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php $db = new PDO('mysql:host=10.11.1.23;hostname=dnergoux', 'dnergoux', 'bts') ?>
  2.  
  3. <html>
  4.     <body>
  5.         ID : <input type = "text" name = "id"><br/>
  6.         Password : <input type = "password" name = "mdp"><br/>
  7.         <input type = "submit" value = "Connexion">
  8.     </body>
  9. </html>
  10.  
  11. <?php
  12.     header('Content:type: text/html; charset=utf-8');
  13.    
  14.     $id = $_POST['id'];
  15.     $psw = $_POST['mdp'];
  16.     $sql = "SELECT * FROM SIO1_UTILISATEUR";
  17.    
  18.     $select_users = $db->query($sql);
  19.     $user = $select_users->fectchAll();
  20.    
  21.     if($user)
  22.     {
  23.         echo "Vous êtes connecté.";
  24.     }
  25.     else
  26.     {
  27.         echo "Ce compte n'est pas enregistré, ou vos identifiants ne sont pas valides.";
  28.     }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement