...

View Full Version : simple selection box



vic_523
12-03-2003, 07:20 PM
I am trying to make a simple selection box using php within my html page....within the form tags I have ...
<select name="selections" size="4">
<?php
$op_array=array("one","two","three","four","five");
foreach($op_array as $option){
print "<option>$option</option>";
}

?>

</select>

Sorry if this looks sily! Im still trying to find my feet with php.
Vic
:O)

firepages
12-04-2003, 03:11 PM
Hi Vic , your code does not look silly but the lack of a question does not help :D what do you want help with ?

....you would normally assign a value to the options ...

echo "<option value=\"$option\">$option</option>";


but other than that I am guessing ~



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum