Hey there,
I've seen pages that have a URL like: http://www.devpapers.com/view_author.php/39
See how they have a /39 after the file name? I'm presuming that ti works the same way as: http://www.devpapers.com/view_author.php?39
How do I get the PHP to read the text after the /?
Thanks
Question about page.php/wordgoeshere
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Code: Select all
// given the url http://www.devpapers.com/view_author.php/39/foo/bar
echo getenv('PATH_INFO'); // outputs: /39/foo/barthe reason thr url still works is because apache will keep seeking for existing filenames in the given url,
first it checks for a file named "bar"
if not found, then it seeks for "foo"
then if not found, it looks for "39"
then, if not found, it looks for "view_author.php" , which it finds. so the PATH_INFO envionment variable will be set based upon the currently executing script