Guest User

Untitled

a guest
Nov 24th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. function curPageURL2() {
  5. $pageURL = 'http';
  6. if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
  7. $pageURL .= "://";
  8. if ($_SERVER["SERVER_PORT"] != "80") {
  9. $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
  10. } else {
  11. $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
  12. }
  13. return $pageURL;
  14. }
  15.  
  16. if(!($_SESSION["email"]&&$_SESSION["password"])){
  17. $_SESSION['back-url'] = curPageURL2();
  18. /*
  19. echo '<script type="text/javascript">
  20. <!--
  21. window.location = "'.$root_url.'/member/login.php"
  22. //-->
  23. </script>';
  24. */
  25. header("Location: ". $root_url . "/member/login.php");
  26. exit;
  27. }
  28. else{
  29. $rs=mysql_query("SELECT * FROM `{$_x(USERS_TABLE)}` WHERE `email`='{$_SESSION['email']}' AND `password`='{$_SESSION['password']}'");
  30. if($userdata=mysql_fetch_assoc($rs));else{header("Location: ". $root_url . "/member/logout.php");exit;}
  31. $isLoggedIn = TRUE;
  32. }
  33. if($_SESSION["errortext"]){$error=$_SESSION["errortext"];$_SESSION["errortext"]="";}
  34. if($_SESSION["successtext"]){$success=$_SESSION["successtext"];$_SESSION["successtext"]="";}
  35. ?>
Add Comment
Please, Sign In to add comment