php select option

// Page containing a form:
<form action="myaction.php" method="post">
 <select name="fruit">
    <option value="Apple">Apple</option>
    <option value="Banana">Banana</option>
 </select>  
 <input type="submit" value="Submit">
</form>

// myaction.php
Hello <?php echo htmlspecialchars($_POST['fruit']); ?>

3.8
5

                                    &lt;?php
    if(isset($_POST['submit'])){
    if(!empty($_POST['Fruit'])) {
        $selected = $_POST['Fruit'];
        echo 'You have chosen: ' . $selected;
    } else {
        echo 'Please select the value.';
    }
    }
?&gt;

3.8 (5 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
php get option value from select html how to select data in option php select value from dropdown php how to get option selected value in php select a select option usinggouttte php how to get option value in php get value from option php select option with php receive data from select php get select option php output select option value in php php select html option php get option value from string php select option value from database option value selected php php select selected select option php get select option value in php php select selected when $_get value select value php select php option in selected in php how to get values from select tag with php selected option msql php option in php php select option from database function select option php input select option php get_option() php how to get selected value in php php select $ option php return value to option in php The select option element with php The select element php php select option selected from database how to get select values form php table option selected php select value get in php php select data php select value selected in select option php select dropdown value get php get data from select query in php php select php value of select option how to selected select php how to get data from select tag in php select in php php get value lelected of select option php get value of select option php get value of option php select option get value how to get option box value in php get value of select option php php get select option value php get_option how to get the value of a select option in php how to grab option in php get option value by name php form select option php get value from selected item php get selected value php select option value = php value from select option php get value option selected php get value from option how to get the value form select option for php How to Get Selected Values from Select Option in php how to get the option value in select tag name in php get value select in php how to select the option value in php how to get value from select in php how to get option in php get_option php how to get select option value in php how to get the value of select option in select box in php html get selected option value php php how to get select option value select and get value php select value from get php php get value from select option $_get php get select value php with $GET get select value php get the value of option selected php option value selected in php how to get selected option value php how to get value of selected option in php get value in select php how to get selected option value in array php php get option value how to get the value of selected option in php get selected option value php get value from option in php php get selected option get selected value php how to get value from select option in php get value from select php php get select value how to get selected option value in php php get selected value from dropdown with submit get the selected value select element php php echo option value selected option value php php form option selected value php echo select option value php if dropdown form select option php php chooseoptions select option selected post get selected value php dropdown how to get the select name in form submit in php php get value from select $_POST of option php how to use the form select value html select post value how to get data select field php php post select option select option name php how can we post the value ina select box using php get value from selected option php html get select value php php post data from select php get data from select select html post php select value html post php select option form get from select form in php php use select option value form php select option php check option value php check select option value get select option value php echo posted selected option data how to get selected option name and value post how to get selected option name post how to get value from select option php php get selected value from select php read selected value of a selct php post select value php select option selected value get value option selected php html select option with php php get value of selected option html select option in php how to get value from option in php php select input how to get selected element php from form how to get selected elemtn php select option value php why php does not get option tag value by GET method When I select a value from select tag php will run select option html php get data in option in php get select value from posted form php post option selected value how to get the value of option in php php use vvalue of select php select option hpw use option html +php get post data from select post values from select how to get post value of selected option Select option php selected value PHP get value from select option php get data from selected item from option php select input option how to get select value in php php html get select option php html select option select option get value php get the value of select value in php post select option value php post method for choosing option php php select option value display selected as value in select form php select html5 how to get the selected field with php how to retrieve select tag thats in php
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source