Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2. //include'database_connect.php';
  3.  
  4. if(isset($_POST['username']))
  5. {
  6.     $username=$_POST['username'];
  7.     $password=md5($_POST['password']);
  8.  
  9.     if($username=="benvenuto" && $password="ospite")
  10.     {
  11.             //setcookie('username',$username,time()+60*60*24*30*12);
  12.             //setcookie('session',$session,time()+60*60*24*30*12);
  13.  
  14.             echo "complimenti, funziona.";
  15.  
  16.             exit;
  17.     }
  18.     else
  19.     {
  20.         echo'Incorrect login.';
  21.         echo'<br/>';
  22.     }
  23. }
  24.  
  25. echo'<form action="" method="post">';
  26.  
  27. echo'Username:';
  28. echo'<br/>';
  29. echo'<input type="text" name="username" value=""/>';
  30. echo'<br/>';
  31.  
  32. echo'Password:';
  33. echo'<br/>';
  34. echo'<input type="password" name="password"/>';
  35. echo'<br/>';
  36.  
  37. echo'<input type="submit" name="submit" value="Sign in"/>';
  38.  
  39. echo'</form>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement