Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php //DO NOT DELETE THIS FILE.
  2. $path=[,’users/,’usersc/];
  3. //Only add or remove values in the $path variable separated by commas above
  4.  
  5. $abs_us_root=$_SERVER['DOCUMENT_ROOT'];
  6.  
  7. $self_path=explode("/", $_SERVER['PHP_SELF']);
  8. $self_path_length=count($self_path);
  9. $file_found=FALSE;
  10.  
  11. for($i = 1; $i < $self_path_length; $i++){
  12.     array_splice($self_path, $self_path_length-$i, $i);
  13.     $us_url_root=implode("/",$self_path)."/";
  14.  
  15.     if (file_exists($abs_us_root.$us_url_root.'z_us_root.php')){
  16.         $file_found=TRUE;
  17.         break;
  18.     }else{
  19.         $file_found=FALSE;
  20.     }
  21. }
  22. //redirect back to Userspice URL root (usually /)
  23. header('Location: '.$us_url_root);
  24. exit;
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement