Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
How can I get the value of the checkbox in PHP?

I am trying to make a registration page for my website but when I run it; it gives error. What am I doing wrong?

<?php
//Form values

$name_value=$_POST['Name_input'];

$Username_value=$_POST['Username_input'];

$DOB_value=$_POST['DOB_input'];

$Password_value=$_POST['Password_input'];

$Phone_number_value=$_POST['Phone_number_input'];

$Python_checkbox_value=$_POST['Python_checkbox'];

$Java_checkbox_value=$_POST['Java_checkbox'];

$C_sharp_checkbox_value=$_POST['C#_checkbox'];

$HTML_checkbox_value=$_POST['HTML_checkbox'];

$Cpp_checkbox_value=$_POST['C++_checkbox'];

$R_checkbox_value=$_POST['R_checkbox'];

$swift_checkbox_value=$_POST['swift_checkbox'];

$kotlin_checkbox_value=$_POST['kotlin_checkbox'];

$JS_checkbox_value=$_POST['JS_checkbox'];
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Take a look at this code :


    <form method="GET">
        <input type="checkbox" value="value" name="name">checkbox label</input>
        <input type="submit">
    </form>

    <?php 

    if (isset($_GET["name"]))
    {
        echo $_GET["name"];
    }

    ?>

As you can see when I submit the form without checking, the parameter in URI is empty because the checkbox isn't defined (I used GET method)

enter image description here

enter image description here

But when I check it, you can see the parameter is name=value

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!