Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.37 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     if(isset($_SESSION['user']))
  4.     {
  5.         session_destroy();
  6.     }
  7. ?>
  8.  
  9. <?php
  10.  
  11.     $LOGIN = $_GET['LOGIN'];
  12.     $LOGIN1 = $_GET['LOGIN1'];
  13.     $REGISTER = $_GET['REGISTER'];
  14.     $REGISTER1 = $_GET['REGISTER1'];
  15.    
  16.     if (isset($_POST['submit'])){
  17.         $username = $_POST["userName"];
  18.         $password = $_POST["password"];
  19.         if($username != null){
  20.             setcookie("name", $username, time()+3600); //cookie made that expires in one hour, named name
  21.         }else{
  22.             echo "Incorrect Username.";
  23.         }
  24.  
  25.  
  26.         //Do stuff here to validate login info
  27.         $con = mysql_connect("localhost","Feral","Adjudicator1");
  28.         if (!$con)
  29.         {
  30.             die('Could not connect: ' . mysql_error());
  31.         }
  32.     }
  33. if(!isset($_SESSION['user'])){
  34.  
  35.         print "<html>";
  36.         print "<body>";
  37.         print "<h1>Please enter your login information:</h1>";
  38.         print "<form action='index.php?LOGIN1' method='post'>";
  39.         print "<legend>Login:</legend>";
  40.         print "<label for='userName'>User Name:</label>";
  41.         print "<input name='userName' id='userName' type='text' tabindex='1' maxlength='20'/>";
  42.         print "<label for='password'>Password:</label>";
  43.         print "<input name='password' id='password' type='password' tabindex='2' maxlength='20' mask='x'/>";
  44.         print "<input type='submit'/>";
  45.         print "<input type='reset'/>";
  46.         print "</form>";
  47.         print "<a href='register.php'>Register</a>";
  48.         print "</body>";
  49.         print "</html>";
  50. }
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement