Quick Question
Moderator: General Moderators
Quick Question
How do you make variables work with URL's like http://mysite.com/index.php?45
as opposed to: http://mysite.com/index.php?somevariable=45
Because I'd like a shorter url.
as opposed to: http://mysite.com/index.php?somevariable=45
Because I'd like a shorter url.
It's simple. It's just like...Here's an example...
Of course, you'd access this via /page.php?food=yummy
Instead, I want it to be /page.php?yummy
I've seen some sites do this but I want to know how it is possible.
Code: Select all
if($_GET[food] == "yummy")
{
print ("that's right. food rules.");
exit;
}
print ("you don't like food? then you stink!");Instead, I want it to be /page.php?yummy
I've seen some sites do this but I want to know how it is possible.
- spamyboy
- Forum Contributor
- Posts: 266
- Joined: Sun Nov 06, 2005 11:29 am
- Location: Lithuania, vilnius
try
or
Code: Select all
if($_GET[] == "yummy")
{
print ("that's right. food rules.");
exit;
}
print ("you don't like food? then you stink!");Code: Select all
if($_GET[?] == "yummy")
{
print ("that's right. food rules.");
exit;
}
print ("you don't like food? then you stink!");