Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function process_url($file_location){
- $url_segments = array();
- $url_request = $_SERVER['REQUEST_URI'];
- $url_segments = explode("/", $url_request);
- $file_name = pathinfo($url_segments[3], PATHINFO_FILENAME);
- if(file_exists($file_location.$file_name.'.php')){
- return ($file_location.$file_name.'.php');
- }
- else{
- return false;
- }
- }
- ## now we define the actual page location
- $actual_file_location = './mtfiles/2014/';
- ## we call the function above
- $this_short_url = ((process_url($actual_file_location) != false)? include(process_url($actual_file_location)) : 'page not available');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement