Advertisement
mrengy

login.php

Aug 5th, 2011
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. <?php
  2.     $error = '';
  3.     if (isset($_POST['login'])){
  4.         session_start();
  5.         $username = $_POST['username'];
  6.         $password = $_POST['pwd'];
  7.         //location of usernames and passwords
  8.         $userlist = '../private/filetest_02.txt';
  9.         //location to redirect on success
  10.         $redirect = 'http://mike-eng.com/temp/php/sessions/menu.php';
  11.         require_once('../includes/authenticate.inc.php');
  12.     }
  13. ?>
  14. <!DOCTYPE HTML>
  15. <html>
  16.     <head>
  17.         <meta charset="utf-8">
  18.         <title>Session test 3</title>
  19.     </head>
  20.  
  21.     <body>
  22.         <?php if ($error) {
  23.         echo "<p>$error</p>";
  24.         } ?>
  25.         <form id="form1" method="post" action="">
  26.             <p>
  27.                 <label for="username">Username:</label>
  28.                 <input type="text" name="username" id="username" />
  29.             </p>
  30.             <p>
  31.                 <label for="pwd">Password:</label>
  32.                 <input type="password" name="pwd" id="pwd" />
  33.             </p>
  34.             <p>
  35.                 <input name="login" type="submit" id="login" value="Log in" />
  36.             </p>
  37.         </form>
  38.     </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement