RE: [PHP-DB] Defined Constants
| From: | Arno Kuhl | Date: | Thu, 13 Oct 2005 07:11:29 +0000 |
| Subject: | RE: [PHP-DB] Defined Constants | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-40500@lists.php.net to get a copy of this message | ||
In your select, you need to remove the quotes around your defines, otherwise
it is interpreted as a quoted string.
So your select statement should look like:
<select name="myType">
<option value=JOVIAL><?=JOVIAL;?></option>
<option value=CHEERFUL><?=CHEERFUL;?></option>
<option value=ADVENTUROUS><?=ADVENTUROUS;?></option>
<option value=MYSTERIOUS><?=MYSTERIOUS;?></option>
</select>
Arno
________________________
DotContent
Professional Content Management Solutions
www.dotcontent.net
-----Original Message-----
From: Ng Hwee Hwee [mailto:hhwee@towa.com.sg]
Sent: 13 October 2005 08:13
To: PHP DB List
Subject: [PHP-DB] Defined Constants
Hi all,
just a very simple question. my form has the following define statements and
select box:
define("JOVIAL", "likes to joke alot");
define("CHEERFUL", "always wears a smile on his face");
define("ADVENTUROUS", "likes sports and plays well too");
define("MYSTERIOUS", "there's always something to discover everyday");
<select name="myType">
<option value="JOVIAL"><?=JOVIAL;?></option>
<option value="CHEERFUL"><?=CHEERFUL;?></option>
<option value="ADVENTUROUS"><?=ADVENTUROUS;?></option>
<option value="MYSTERIOUS"><?=MYSTERIOUS;?></option>
</select>
after i post my form, the value $myType will be one of my define statements.
For example, user chooses "CHEERFUL" thus when i echo $myType, I will get
"CHEERFUL" but actually, what i really want to get is "always wears a smile
on his face".
can someone advise me how i can achieve this?? sounds simple but i really
don't know how!! =(
thanks in advance!!
hwee