Skip to content

Instantly share code, notes, and snippets.

@riandesign
Created January 5, 2018 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riandesign/553a5b7d125c872e2a8a381d3c4ccc3e to your computer and use it in GitHub Desktop.
Save riandesign/553a5b7d125c872e2a8a381d3c4ccc3e to your computer and use it in GitHub Desktop.
radiobutton.php
<!DOCTYPE html>
<html>
<body>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!isset($_POST['genero'])) {
echo'Por favor, marque o sexo<hr>';
} else {
$genero = $_POST['genero'];
echo 'Seu sexo é ' . $genero . '<hr>';
}
}
?>
<form action="" method="post">
<input type="radio" name="genero" value="masculino"> Masculino<br>
<input type="radio" name="genero" value="feminino"> Feminino<br>
<br>
<input type="submit">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment