Hi everyone,
Can you please let me know how I can assign the selected value from a dropdown list into a $variable and print or echo it in the screen
For Example if I have a dropdown list of years like:
<?php
$years = array();
for ($i = 1900; $i < 2026; $i++)
{
$years[] = $i;
}
echo "<select name='Year'>";
foreach($years as $option){
echo "<option value='{$option}'>{$option}</option>";
}
echo "</select>";
?>
Now I want to save the selected value in a variable to do any further process?
Thanks for your time, in advance.