How Do I Get Multiple Input Checkbox Data Using PHP

admin_img Posted By Bajarangi soft , Posted On 27-11-2020

Using PHP we can pass multiple checkbox data .So today we discuss how to do it.

How Do I Get Multiple Input Checkbox Data Using PHP

Complete Code For Getting Multiple Input Checkbox Data Using PHP.

<!DOCTYPE html>
<html>
<head>
    <title>How To Implement PHP Code For Swapping Two Numbers</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
    body {
        background: black;
    }
</style>
<body>
<body>
<div class="container">
    <br/><br/>
    <div class="text-center">
        <h1 id="color" style="color: white;">PHP Code For Swapping Two Numbers</h1>
    </div>

    <div class="well">
        <form action="" method="post" enctype="multipart/form-data">
            <h3>Select Languages:</h3>
            <label>PHP</label>
            <input type="checkbox" name="lang[]" value="PHP"><br><br>
            <label>HTML</label>
            <input type="checkbox" name="lang[]" value="HTML"><br><br>
            <label>JAVASCRIPT</label>
            <input type="checkbox" name="lang[]" value="JAVASCRIPT"><br><br>
            <input type="submit" value="submit" class="btn btn-success" name="submit">
        </form>
        <?php
        if (isset($_POST['submit'])) {
            print_r($_POST['lang']);
        }
        ?>
    </div>
</div>
</body>
</html>

Related Post