Re: passing parameters in the url using forward slashes

From: Date: Wed, 09 May 2001 12:17:08 +0000
Subject: Re: passing parameters in the url using forward slashes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52090@lists.php.net to get a copy of this message
The Wise Man Said: <WISE MAN's EMAIL> Subject: RE: [PHP3] URL without a classic php filename like php, php3, phtml? Date: Tue, 11 Apr 2000 12:54:35 MST From: php3@developersdesk.com To: "Michael Simcich" <msimcich@accesstools.com>, php3@lists.php.net Addressed to: "Michael Simcich" <msimcich@accesstools.com> php3@lists.php.net ** Reply to note from "Michael Simcich" <msimcich@accesstools.com> Tue, 11 Apr 2000 11:23:16 -0700 > Is there any way to pass parameters with php without using the > classic http://www.whatever.com/somepage.php?param=3 type > format? So > that the url would look more like In httpd.conf, in the <VirtualHost> block for the site: <Location /ThisIsAProgram> ForceType appllication/x-http-php </Location> In a php program file, named ThisIsAProgram in the DocumentRoot of the site: ========================== <? $Params = explode( '/', $PATH_INFO ); while( list( $Index, $Value ) = each( $Params )) { echo "Params[ $Index ] = $Value<BR>\n" ); } ?> ========================== Hit this URL: http://whatever.site.com/ThisIsAProgram/these/directories/are/not/real You should get: Params[ 0 ] = Params[ 1 ] = these Params[ 2 ] = directories Params[ 3 ] = are Params[ 4 ] = not Params[ 5 ] = real If you can't or don't want to do the <Location> thing, you can name the file ThisIsAProgram.php (or .php3) and call it: http://whatever.site.com/ThisIsAProgram.php/these/directories/are/not/re al But I think it is pretty cool to make the program name look like just another directory in the tree, so I usually use <Location>. Rick Widmer Internet Marketing Specialists www.developersdesk.com </WISE MAN's EMAIL> -Stathis. Franklin van Velthuizen wrote: > > Good morning/afternoon/evening.. whatever timezone you live in :) > > Small question: we all know how to pass parameter using question marks in an URL ofcourse.. > but I was wondering whether it was also possible to pass parameters in the URL using forward > slashes instead of those question marks, so like: > > http://blabla/file.php/value > > and use "value" as a parameter, obviously. > > I just tried it, but all I got was an internal server error :(. > > Anyone who knows *anything* about this? > > Take care, > /franklin > > -- > Franklin van Velthuizen fv@ebiris.se +46-(0)19-10 99 17 > Ebiris AB www.ebiris.se +46-(0)19-10 99 10

« previous php.general (#52090) next »