I'm having a problem running a form script. It used to work before, but now when I submit the form an error pops up and it won't write to the database: This is the error: [Sun Aug 17 16:46:54 2008] [error] [client 127.0.0.2] PHP Notice: Undefined variable: selected_state in /srv/www/htdocs/djtommer/contact.php on line 243 This is the code: ------------- foreach($state_list as $key=>$value){ if($selected_state == $key){ $sel = 'selected="selected"'; } else{ $sel = ''; } echo "<option $sel value=\"$key\">$value</option>"; } echo '</select>'; ?> ---------- -- Michael S. Dunsavage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php