SHARE
TWEET

Untitled

a guest May 22nd, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. function verify_user($username, $password) {
  4.     global $mysqli;
  5.     if (!$mysqli->connect_errno) {
  6.         $sql = "SELECT * FROM pacienti_users WHERE username='$username' AND password=MD5('$password')";
  7.         if (($result = $mysqli->query($sql)) && ($result->num_rows > 0)) {
  8.             echo $sql;
  9.             $row = $result->fetch_assoc();
  10.             $result->free();
  11.             echo $row;
  12.             return $row;
  13.         } else {
  14.             return false;
  15.         }
  16.     } else {
  17.         return false;
  18.     }
  19. }
  20.  
  21. function page_header($title) {
  22.     ?>
  23.     <!DOCTYPE html>
  24.     <html>
  25.     <head>
  26.     <meta charset="utf-8">
  27.     <title><?php echo $title; ?></title>
  28.     </head>
  29.  
  30.     <body>
  31.  
  32.     <header>
  33.  
  34.     <?php
  35. }
  36.  
  37. function login() {
  38.     ?>
  39.     <div>
  40.     <form method="post">
  41.     <input name="username" type="text" size="30" maxlength="30" id="username"><br>
  42.     <input name="password" type="password" size="30" maxlength="30" id="password"><br>
  43.     <input name="login" type="submit" id="login" value="Prihlás ma">
  44.     </form>
  45.     </div>
  46.    
  47.     </header>
  48.     </body>
  49.     <?php
  50. }
  51.  
  52. function loggout() {
  53.     ?>
  54.     <div>
  55.     <form method="post">
  56.     <input name="loggout" type="submit" id="loggout" value="Odhlás ma">
  57.     </form>
  58.     </div>
  59.    
  60.     </header>
  61.     </body>
  62.     <?php
  63. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top