Afternoon,
I have a foreach loop and within that loop is a select box. Now I want to say if the value of the posted selected value ($_POST[‘for_title’]) is what has been selected then make it ‘selected’ – ie hold the value.
$html = '<select name="for_title" class="inputbox">' . "\
";
foreach ($options as $key=>$value) {
$html .= '<option value="'.$key.'';
if ($_POST['for_title'] == $key ) { $html .=' selected'; }
$html .= '">'.$value.'</option>' . "\
";
}
$html .= "</select>
here’s my code, any idea as i’s not working?
Thanks