LuChenVahn
New Member
I have a php page where users may enter data into fields inside a form.The form also has a picture upload utility.This page is refreshed every time a new picture is uploaded, so to 'remember' the values the user ALREADY has filled in, I have this code:\[code\]<input type="text" value="http://stackoverflow.com/questions/1996132/<?php echo @$_POST['name'];?>">\[/code\]This DOESN'T work for drop lists or radios...I have one solution from a previous Q but that would mean I would have to create all drop lists again in PHP, when they are in HTML now, and it is ALOT of options in the drop lists.Is there any other way?Here is the first solution:\[code\]$color = $_POST["colors"];$colors = array("red","green","blue");<select name="colors"><?php foreach ($colors as $option) { ?> <option<?php print ($option == $color) ? " selected" : ""; ?>> <?php print $option; ?> </option><?php } ?></select>\[/code\]Thanks