Re: Re: create htaccess.
| From: | adwinwijaya | Date: | Mon, 06 Dec 2004 01:31:01 +0000 |
| Subject: | Re: Re: create htaccess. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203548@lists.php.net to get a copy of this message | ||
Hello Matthew,
Monday, December 6, 2004, 11:33:28 AM, you wrote:
MWOP> In you .htaccess:
MWOP> <File index>
MWOP> ForceType application/x-httpd-php
MWOP> </File>
MWOP> DirectoryIndex index
MWOP> Then, in your script, you'll need to access the PATH_INFO environment
MWOP> variable via the $_SERVER array to parse out the argument(s):
MWOP> $pi = $_SERVER['PATH_INFO']; // Grab PATH_INFO
MWOP> $pi = substr($pi, 1); // Remove the opening slash
MWOP> $args = split('/', $pi); // Create array of arguments
MWOP> $f = $args[0]; // Grab first argument
MWOP> --
MWOP> Matthew Weier O'Phinney |
MWOP> mailto:matthew@garden.org
MWOP> Webmaster and IT Specialist | http://www.garden.org
MWOP> National Gardening Association |
MWOP> http://www.kidsgardening.com
MWOP> 802-863-5251 x156 |
MWOP> http://nationalgardenmonth.org
I just want to clarify,
if I type:
www.mysite.com/article/file/19911/year/2004
means: www.mysite.com/article.php?file=19911&year=2004 right ?
:)
and i have to put this script on my article.php, is it right ?
$pi = $_SERVER['PATH_INFO']; // Grab PATH_INFO
$pi = substr($pi, 1); // Remove the opening slash
$args = split('/', $pi); // Create array of arguments
$f = $args[0]; // Grab first argument
thank you ...
--
Best regards,
adwin
www.kuya-kuya.net