Subject says it all. I can't seem to make a function that works to do this. Can someone please give me some sample code or some points or something. I can't for the life of me figure out what i'm doing wrong. thanks in advance
php4 and mysql are being used. right now there are only 3 options.
using an array:
foreach ($array as $value) {
}
oops.
<select name="thelistislife"> <? foreach ($array as $value) { echo '<option>' . htmlspecialchars($value) . '</option>'; } ?> </select>
Tom, i get this error when i try and parse your code....
Warning: Invalid argument supplied for foreach() in c:/web stuff/i5/admins/i5_admin_addnews3.php on line 25
any ideas?
may i also mention that i've only been using php for about a week, so if you could explain everything and keep it as simple as possible(KISS) it'd be a big help. thanks
You're not setting up $array. You'll need to study the manual and code examples if you are unable to implement my demo code.
Tom
Exactly the simple code I needed to display my array (a directory of files) into a dropdown! Thanks!
Andreas