DEV Community

loading...
Cover image for PHP form 40: input text textarea select

PHP form 40: input text textarea select

antelove19 profile image Falah Al Fitri Updated on ・1 min read

Happy Coding



Previous

We will create form with type select input:

    <form method="post" action="process.php" >

        Firstname: <input type="text" name="firstname" />
        <br />

        Lastname: <input type="text" name="lastname" />
        <br />

        Description: <textarea name="description" rows="10" cols="50"></textarea>
        <br />

Add input type select:

        Programming Language (single):
        <select name="language" >
            <option value="c" >C</option>
            <option value="c++" >C++</option>
            <option value="java" >Java</option>
            <option value="javascript" >Javascript</option>
            <option value="php" selected >PHP</option>
        </select>

        <br />

        <hr />

        <input type="submit" name="submit" value="Submit" />

    </form>

And, the process:

    echo "<pre>";

    var_dump($_POST);

Source Code Next


Thank for reading :)

Discussion (0)

Forem Open with the Forem app