...

View Full Version : retrieve url parameter



docock
09-26-2011, 11:56 AM
Let's say I've got this url:

http://www.mydomain.com/test/product/free

How can I store the values 'test', 'product' and 'free' each in seperate variables ?

I've searched it with google, but couldn't find it.

gvre
09-26-2011, 12:32 PM
list(, $var1, $var2, $var3) = explode("/", $_SERVER['REQUEST_URI']);

or

$path = explode("/", $_SERVER['REQUEST_URI']);
array_shift($path);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum