Topic awaiting preservation: PHP If-Case-... (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: Carinthia |
posted 06-20-2002 08:18
This is the source of site, where the menu workes with variables. Every Link gives a parameter over the URL. The variable is $cat. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-20-2002 08:30
You can just do this. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-20-2002 08:35
Well, your code appears to be fine... The problem is probably related to how PHP is configured. You didn't specify which version of PHP you have on server, so I'll talk generally. New versions of PHP come with "register_globals" option turned off (security reasons) and as a result parameters from URL won't be converted to variables automatically. If you have PHP version 4.1.0 or higher, replace all occurrences of "$cat" with "$_GET['cat']", otherwise replace all occurrences of "$cat" with "$HTTP_GET_VARS['cat']". Also, if you have any function which uses $cat variable and you have PHP version lower than 4.1.0, you'll need to add "global $HTTP_GET_VARS;" at the top of your function(s)... |
Nervous Wreck (II) Inmate From: Carinthia |
posted 06-20-2002 08:36
This is the source of a friend. What means the switch????? |
Nervous Wreck (II) Inmate From: Carinthia |
posted 06-20-2002 08:39
I thank. It works. I didn´t knew about the versions. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-20-2002 09:07
Documentation for "switch" statement can be found here: http://www.php.net/manual/en/control-structures.switch.php |