Advertisement
Guest User

Untitled

a guest
Feb 19th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2. function process_url($file_location){
  3. $url_segments = array();
  4. $url_request = $_SERVER['REQUEST_URI'];
  5. $url_segments = explode("/", $url_request);
  6. $file_name = pathinfo($url_segments[3], PATHINFO_FILENAME);
  7. if(file_exists($file_location.$file_name.'.php')){
  8. return ($file_location.$file_name.'.php');
  9. }
  10. else{
  11. return false;
  12. }
  13. }
  14. ## now we define the actual page location
  15. $actual_file_location = './mtfiles/2014/';
  16. ## we call the function above
  17. $this_short_url = ((process_url($actual_file_location) != false)? include(process_url($actual_file_location)) : 'page not available');
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement