Hi everyone,
Forgive my newbie PHP skills, but I'm trying to learn.
I've got a recordset on my detail page that can hold up to 5 possible colors for an item. For example, let's say Color1=blue, Color2=red, Color3=white. Color4 and Color5 are null values.
I obviously only want to populate the Available Colors listbox with non-null values. I'm having trouble with my php code, and was hoping someone could tell me why it doesn't work:
-
<form id="form1" name="form1" method="post" action="">
-
<label>Available Colors
-
<select name="Colors" id="Colors">
-
-
<?php
-
if (strlen($row_rs_assoc_colors['color1'])>0) {
-
<option>'$row_rs_assoc_colors['color1']'</option>
-
} ?>
-
-
</select>
-
</label>
-
</form>
-
Can I execute php within the html I have above? Or is there a better way to do this?
Additionally, I'd like to show the Available Colors drop-down list ONLY if an item has Color1 populated in the assoc_colors table. Meaning that sometimes an item won't come in any colors at all, and therefore I don't need to see the listbox. But I guess that's another question...
Thanks in advance for any help!
-Vozz