Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2.  
  3. //session_name('LOGGEDIN');
  4. session_start();
  5.  
  6. if (isset($_POST['userLogin'])){
  7. $userName = $_POST['userBox'];
  8. $userPassword = $_POST['passwordBox'];
  9. } else {
  10. $userName = $_SESSION['userBox'];
  11. $userPassword = $_SESSION['passwordBox'];
  12. }
  13.  
  14.  
  15. if (!isset($userName)){
  16.  
  17. echo("<h1>Login</h1>
  18. <form action = '$self' method='POST'>
  19. <p>Username: <input name='userBox' type='text'></p>
  20. <p>Password: <input name='passwordBox' type='password'></p>
  21. <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  22. <input name='userLogin' style='width: 104px' type='submit' value='Login'></p><br>
  23. <p>Not Registered?<a href='vidsOnlineReg.php' class='redLink'>Create Account</a></p><br><br>
  24. </form><br><br><h2>Items In Cart: 0</h2>exit");
  25.  
  26.  
  27. }else{
  28. $selectString = "SELECT userBox, passwordBox FROM tblCustomers WHERE (userBox = '$custUser') AND (passwordBox = '$custPWord')";
  29. $result = mysql_query($selectString);
  30. $row = mysql_fetch_row($result);
  31.  
  32. if ($row > 0){
  33. $_SESSION['userName']=$userBox;
  34. $_SESSION['userPassword']=$passwordBox;
  35. echo ("Welcome $userBox, hope your having a great dat.");
  36. }else{
  37. echo ("Incorrect loging, please try again or register.");
  38. exit;
  39. }
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement