Guest User

Untitled

a guest
Aug 5th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['login']))
  3. {
  4. $username = ucfirst($_POST['first'])."-".ucfirst($_POST['second']);
  5. if(!isset($_POST['first']) || $_POST['first'] == "" || !isset($_POST['second']) || $_POST['second'] == "" || !isset($_POST['password']) || $_POST['password'] == "")
  6. {
  7. $_SESSION['user']['loggedin'] = false;
  8. $err = "You must fill in all the required fields..";
  9. }
  10. else if(!TryLogin($username, md5($_POST['password'])))
  11. {
  12. $_SESSION['user']['loggedin'] = false;
  13. $err = "The username and password you entered is invalid";
  14. }
  15. else
  16. {
  17. $_SESSION['user']['loggedin'] = true;
  18. }
  19. }
  20. if($_SESSION['user']['loggedin'] == true)
  21. { ?>
  22. <script type="text/javascript">$(document).ready(function(){ document.location="me.php" } )</script>
  23. <?php
  24. $err = "Please wait...";
  25. }
  26. if(isset($err)) { ?>
  27. <script type="text/javascript">$(document).ready(function(){ DropDownAlert("<?php echo $err; ?>") } )</script>
  28. <?php }
  29. if(!isset($_POST['js']))
  30. {
  31. ?>
  32. <div class="main_content">
  33. <?php } ?>
  34.  
  35. <div class="header">
  36.  
  37. Sign In
  38.  
  39. </div>
  40.  
  41. <div class="content no_margin">
  42.  
  43.  
  44.  
  45. <form class="form" action="login.php" name="login" method="post">
  46. First Name:<br />
  47. <br />
  48. <input class="input_default" type="text" name="first" value="<?php echo $_POST['first']; ?>" /><br />
  49. <br />
  50. Second Name:<br />
  51. <br />
  52. <input class="input_default" type="text" name="second" value="<?php echo $_POST['second']; ?>" /><br />
  53. <br />
  54. Password:<br />
  55. <br />
  56. <input class="input_default" type="password" name="password" value="<?php echo $_POST['password']; ?>" /><br />
  57. <br />
  58. <input class="input_default_submit" type="submit" name="login" value="Sign In" />
  59. </form>
  60. <hr />
  61. <a class="popup" href="register.php">Don't have an account yet? Register!</a>
  62.  
  63. </div>
Add Comment
Please, Sign In to add comment