Hello. I have a question where I need to get information from the user and send it to php. I am not getting the information of the user's choice. He must choose whether he is a client or an employee in the options. I would like to know if it is possible to send this information, because I have a table called a post in the bank where I keep the user or a client.
Form
<form class="" method="post" action="controleUsuario.php">
<h1 class=""><b>Cadastrar</b></h1>
<div class="form-group"> <label for="nome">Nome:</label> <input type="text" class="form-control" name="nome" id="nome" placeholder="Digite seu nome"> </div>
<div class="form-group"> <label for="email">Email:</label> <input type="text" class="form-control" id="email" name="email" placeholder="Digite seu Email"> </div>
<div class="form-group"> <label for="senha">Senha:</label> <input type="password" class="form-control" id="senha" name="senha" placeholder="Digite sua senha"> </div>
<label class="mr-sm-2 sr-only" for="escolha">Escolha:</label>
<div class="form-row align-items-left">
<div class="col-auto my-1">
<select class="custom-select mr-sm-2" name="escolha" id="escolha">
<option name="cliente" id="cliente" value="Cliente">Cliente</option>
<option name="funcionario" id="funcionario" value="Funcionario">Funcionario</option>
</select>
</div>
</div>
<button type="submit" name="opcao" value="Cadastrar" class="btn btn-primary">Comfirmar</button>
</form>
User Control
if(isset($_POST["opcao"])){
$opcao = $_POST["opcao"];
$escolha = $_POST["escolha"];
if($opcao == "Cadastrar"){
if($escolha=="Funcionario"){
$funcionario=$_POST["funcionario"];
$nome = $_POST["nome"];
$email = $_POST["email"];
$senha =sha1($_POST["senha"]);
cadastroFuncionario($nome,$email,$senha,$funcionario);
header("Location: loginUsuario.php");
}else if($escolha=="Cliente"){
$cliente=$_POST["cliente"];
$nome = $_POST["nome"];
$email = $_POST["email"];
$senha =sha1($_POST["senha"]);
cadastroCliente($nome,$email,$senha,$cliente);
header("Location: loginUsuario.php");
}
}