Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda