html php and select box simplification -
Is it a better way to use HTML and PHP?
If I have a billion worth, it would be a bad way of setting them, will not even mention about taking time?
I'm a new one, and I'm pretty sure there is a better way, though, my method seems to last for a long time, I'm pretty sure it's easy to set up And that's what I want or ask?
& lt; Choose name = "dimes" & gt; & Lt; Option value = "" & gt; - Select Dimes --- & lt; / Options & gt; & Lt; Option value = ".10" & gt; 10c & lt; / Options & gt; & Lt; Option value = ".20" & gt; 20c & lt; / Options & gt; & Lt; Option value = ".30" & gt; 30c & lt; / Options & gt; & Lt; Option value = ". 40" & gt; 40c & lt; / Options & gt; & Lt; Option value = ". 50" & gt; 50c & lt; / Options & gt; & Lt; Option value = ".60" & gt; 60c & lt; / Options & gt; & Lt; Option value = ".70" & gt; 70c & lt; / Options & gt; & Lt; Option value = ".80" & gt; 80c & lt; / Options & gt; & Lt; Option value = ". 90" & gt; 90c & lt; / Options & gt; & Lt; Option value = "1.00" & gt; $ 1.00 & lt; / Options & gt; & Lt; / Select & gt;
Thank you for the Nub Fleming, I'm still learning.
If you have mixed PHP & amp; Prefer to experiment; HTML, you can use this type of construction:
& lt; Select name = "dimes" & gt; & Lt; Option value = "" & gt; - Select Dimes --- & lt; / Options & gt; & Lt ;? Php foreach ($ date as $ key = & gt; $ value):? & Gt; & Lt; Option value = "& lt ;? php echo $ key ;;>" & Gt; & Lt ;? Php $ value; ? & Gt; & Lt; / Options & gt; & Lt ;? Php endforeach; ? & Gt; & Lt; / Select & gt;
Note, before you can use it in the foreach
statement, you must define and fill the $ dates
. You can fill the $ dates
with your data in this example array, something like this: array ('0.1' => '0.1', '0.2' = & gt; ; '0.2');
But moreover you can go ahead and use the result of MySQL query to fill the ARL with the keys and values. See for more information.
Comments
Post a Comment