RE: [PHP] Variabe != Value???
| From: | John W. Holmes | Date: | Fri, 16 May 2003 10:55:24 +0000 |
| Subject: | RE: [PHP] Variabe != Value??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147873@lists.php.net to get a copy of this message | ||
> I just found a very strange thing inside my code. I tried to make a
> standard GET link like:
>
> <a
>
href=\"".$PHP_SELF."?product_list&action=editproduct&product_id=0001>EDI
T<
> /a>
>
> which should work right?.... WRONG!!!!
>
> when I try to recognize the "$action" variable it just goes through
> without reading it... I checked my code for hours and every IF and
ELSEIF
> look fine. Now, if I take the "$action" variable away and justleaves
> "editproduct", the code listen ok... Any ideas? maybe a reserved
variable?
You need a variable name and an equal sign in the URL with an optional
value. So you want something like this:
href=\"".$PHP_SELF."?product_list=&action=editproduct&product_id=0001>ED
IT<
Notice the equal sign after "product_list" that was missing. The old way
you were doing it was probably trying to create a variable named
"product_list&action" which isn't valid.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
PS: The "optional" value may not be correct according to some
specifications. I don't know if XHTML or HTML 4 or whatever require you
to have a value portion in the URL or not...