Advertisement
Guest User

Untitled

a guest
Jun 30th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.38 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['submit'])){
  3. if(!empty($_POST[username]) || !empty($_POST[password])){
  4. if($_POST[jeef8ih]){
  5. setcookie('ee13ee', $_POST[username], 60 * 60 * 24 * 60 + time());
  6. setcookie('aa765d', $_POST[password], 60 * 60 * 24 * 60 + time());
  7. }
  8. } else {
  9. }
  10. header('Location: '.$_SERVER[PHP_SELF]);
  11. }
  12. if(isset($_POST['forget'])){
  13. setcookie('ee13ee', "", 60 * 60 * 24 * 60 + time());
  14. setcookie('aa765d', "", 60 * 60 * 24 * 60 + time());
  15. header('Location: '.$_SERVER[PHP_SELF]);
  16. }
  17. $textInput[1] = (($_COOKIE[ee13ee] == true) ? '<input type="text" name="username" value="'.$_COOKIE[ee13ee].'" />' : '<input type="text" name="username" />');
  18. $textInput[2] = (($_COOKIE[aa765d] == true) ? '<input type="password" name="password" value="'.$_COOKIE[aa765d].'" />' : '<input type="password" name="password" />');
  19. $form = <<< FORM
  20. <form action="$_SERVER[PHP_SELF]" method="post">
  21. <div style="padding:10px;background:lightyellow;border:1px solid gray;">
  22. <span>Username: $textInput[1]</span><br />
  23. <span>Password: $textInput[2]</span>
  24. <input type="checkbox" name="jeef8ih" />Remember?<br /><input type="submit" name="submit" value="Login!" /><input type="submit" name="forget" value="Forget Me" />
  25. <b style="color:red;"><br />Note: This is not a real login, it will just remember your details. It will remember your details for two months. You can also overwrite it.</b>
  26. FORM;
  27. echo $form;
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement