<?php

 

if(isset($_GET['submit'])) {

    $var = $_GET['option1'];

    if(isset($var)) {

        echo "Option 1 submitted successfully";

    }

}

?>

<html lang="en">

<head>

    <title>GeeksforGeeks Example</title>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href=

    <style>

        .gfg {

            font-size:40px;

            font-weight:bold;

            color:green;

        }

        body {

            text-align:center;

        }

    </style>

</head>

<body>

    <div class="container">

        <div class = "gfg">GeeksforGeeks</div>

        <h2>Form control: checkbox</h2>

        <p>The form below contains one checkbox.</p>

        <form method="get">

            <div class="checkbox">

                <label><input type="checkbox" name = "option1"

                        value="Option 1">Option 1</label>

                <label><button name="submit" value='true'

                    class="btn btn-default">SUBMIT</button>

            </div>

        </form>

    </div>

</body>

</html>

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *