Can you use the input selected from an HTML "<select><option></option></select>" statement and put that within a form to be added to a database? I want the user to select a month and a day and press a button and have it added. Please help.

Hi,

html code :

<Form method="post" action="your_php.php">
    Select a month : 
    <Select name="month">
       <Option value="1">Jan</option>
       <Option value="2">Feb</option>
       ...
    </Select>
    Select a day : 
    <Select name="day">
       <Option value="1">Mon</option>
       <Option value="2">Tue</option>
       ...
    </Select>
</Form>

PHP code (your_php.php) :

$month = $_POST['month'];
$day = $_POST['day'];
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.