astarmathsandphysics Posted February 8, 2015 Share Posted February 8, 2015 I have a free coursework website with 20000 courseworks sorted into folders IThe ame page title appears on each page except when a doc/pdf file displays in the browser. I would like to set the page title as the path. I am using a single index.php file to load every page so I only need a single piece of code I think. How do I do this in php? Quote Link to comment Share on other sites More sharing options...
kierany5 Posted February 10, 2015 Share Posted February 10, 2015 (edited) There are a few options. You could do some research on apaches mod_rewrite Also, you could consider $_SERVER['PATH_INFO']; From PHP Docs: 'PATH_INFO' Contains any client-provided pathname information trailing the actual script filename but preceding the query string, if available. For instance, if the current script was accessed via the URL http://www.example.com/php/path_info.php/some/stuff?foo=bar, then $_SERVER['PATH_INFO']would contain /some/stuff. See: http://php.net/manual/en/reserved.variables.server.php Edited February 10, 2015 by kierany5 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.