Only register if Checkbox is checked

Asked

Viewed 36 times

-3

I would like it to be registered only if the checkbox is marked, I thank you

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • Do not manifest code with images. It is difficult to read, you have to open in another tab on a desktop, a laptop has to leave the page and does not allow those who answer the question use [CTRL + C], [CTRL + V].

1 answer

0

HTML

<input type="checkbox" name="checkbox" value="Termos e Condicoes">

PHP

if(isset($_POST["checkbox"])){
   echo "Checkbox Marcado";
   ...
   // Cadastre o usuário
   ...
}else{
   echo "Checkbox Desmarcado";
   ...
   // Retorne para a página principal informando o erro
   ...
}

Note: In the image you posted the checkbox name is "chechbox", remember to receive $_POST["chechbox"] in php page... :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.