Re: Re: create htaccess.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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           | mailto:matthew@xxxxxxxxxx
MWOP> Webmaster and IT Specialist       | http://www.garden.org
MWOP> National Gardening Association    | 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux