Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(isset($_SESSION['user']))
- {
- session_destroy();
- }
- ?>
- <?php
- $LOGIN = $_GET['LOGIN'];
- $LOGIN1 = $_GET['LOGIN1'];
- $REGISTER = $_GET['REGISTER'];
- $REGISTER1 = $_GET['REGISTER1'];
- if (isset($_POST['submit'])){
- $username = $_POST["userName"];
- $password = $_POST["password"];
- if($username != null){
- setcookie("name", $username, time()+3600); //cookie made that expires in one hour, named name
- }else{
- echo "Incorrect Username.";
- }
- //Do stuff here to validate login info
- $con = mysql_connect("localhost","Feral","Adjudicator1");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- }
- if(!isset($_SESSION['user'])){
- print "<html>";
- print "<body>";
- print "<h1>Please enter your login information:</h1>";
- print "<form action='index.php?LOGIN1' method='post'>";
- print "<legend>Login:</legend>";
- print "<label for='userName'>User Name:</label>";
- print "<input name='userName' id='userName' type='text' tabindex='1' maxlength='20'/>";
- print "<label for='password'>Password:</label>";
- print "<input name='password' id='password' type='password' tabindex='2' maxlength='20' mask='x'/>";
- print "<input type='submit'/>";
- print "<input type='reset'/>";
- print "</form>";
- print "<a href='register.php'>Register</a>";
- print "</body>";
- print "</html>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement