variables via / (again)
| From: | Ashley M. Kirchner | Date: | Sat, 06 Oct 2001 05:09:05 +0000 |
| Subject: | variables via / (again) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70202@lists.php.net to get a copy of this message | ||
Okay, so I have the following in my script:
list($script,$var1,$var2) = explode('/',$_SERVER["PATH_INFO"]);
...now, this is assuming the URL is at
http://www.domain.com/script/foo/bar
...which would make $script = script, $var1 = foo and $var2 = bar
How do people deal with scripts that are in other locations?
Manually change that 'list/explode' line every time?
--
H | "Life is the art of drawing without an eraser." - John Gardner
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley@pcraft.com> .
303.442.6410 x130
Director of Internet Operations / SysAdmin . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
http://www.pcraft.com ..... . . . Boulder, CO 80303,
U.S.A.