user something like this:

the thing you're looking for is the SELECTED bit of the select drop down ...

echo '<select name="month" onChange="document.thisForm.submit()">';
$months = Array("January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December");

for ($x=1; $x <= count($months); $x++)
        {
        print "\t<option value=\"$x\" ";
        print ($x == intval($cmonth)) ? " SELECTED":" ";
        print ">".$months[$x-1]."\n</option>";
        }
echo ' </select> ';

get the form to submit itself using action=<?php print $PHP_SELF() ?>

Steve

> -----Original Message-----
> From: Johan [mailto:[EMAIL PROTECTED]]
> Sent: 29 April 2001 16:02
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] PHP problem
> 
> 
> Dear Sir/Madam,
> 
> I have a mysql database available with user information. I want that
> visitors have the change to change their personel 
> information. Now the form
> works with two different types of fields. edit-fields and
> selectie/option-lists.
> 
> How do I get the value of a user from a selectionlists selected in the
> form-field. All options must be availabele, but the value of 
> the user must
> be selected in the form field.
> 
> If anyone can help me please mail me at [EMAIL PROTECTED]
> 
> Thanks
> 
> Johan.
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to