View Full Version : how does "page.php/11/" work?

01-26-2004, 04:32 PM
I came upon this page php website and this url:
is sort of like a template. And if you add a number to the end like:
you'll see valid product info.

I would've guessed to make a page, say bundles.php and to display valid info, it would be bundles.php?id=14
So how does this "bundles.php/14/" work? with the slashes (and without a variable like "?id="). Thanks.

01-26-2004, 04:36 PM
he... i just fookin' asked that.

01-26-2004, 04:50 PM
i figured it out.

function strip_ID($str)
$str = str_replace("/", "", $str);
return $str;

echo strip_ID($_SERVER["PATH_INFO"]); # a url HTTP://domain/dir/dir/filename/666/ returns /666/ so you have to strip the / out and replace it with nothing

you can see the result at http://devleworm.com/window/phpinfo/64654654645654/

01-26-2004, 05:05 PM
Plenty of tutorials for mod_rewrite too, which is more effective I think

01-26-2004, 05:07 PM
ah ha. yes it is. i figured it was something with the apache server. thanks a lot!

01-26-2004, 05:16 PM
reference: http://www.sitepoint.com/article/910

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum