Page 1 of 1

passing variables in url

Posted: Mon Jul 27, 2009 4:41 am
by gth759k
I usually pass variables to my pages through the url like this:

http://www.whatever.com/page.php?var=1

and then I retrieve the variable from page.php like this:

Code: Select all

 
if (isset($_GET['var'])) {
       // do something
}
 
My question is:

Is there a way to pass a variable to my pages through the url like this:

http://www.whatever.com/var

and this not take me to a folder called var?

For instance http://www.myspace.com/tom takes me to Tom Anderson's page whereas http://www.myspace.com/tom/ (notice the / on the end) doesn't exist. Is this something that php supports or is it only available in whatever language myspace is written in. Any help would be appreciated. Thanks.

Re: passing variables in url

Posted: Mon Jul 27, 2009 5:05 am
by VladSun