I know it's possible to "call" the name of a form into a php file. But in a php file, it is possible to "call" a class made in a form to get the same effect of "calling" the name, that is, how to send data from a form to a php file through a class? >
Specifying, to send through the name I use the following php code:
$variável = $_POST['name'];
But how do I if instead of name is a class?
OBS 1; I already tried to replace the name with the class, but it did not work. OBS 2; I do not have access to the form file, so I can not just enter a name to use the code mentioned above.
Form:
<table>
<form name="form" method="post" action="">
<tr>
<td>
<label>Email</label>
</td>
<td>
<input type="text" name="email">
</td>
</tr>
<tr>
<td>
<label>Senha</label>
</td>
<td>
<input type="password" name="senha">
</td>
</tr>
<input type="submit" class="botao-login" value="Login">
</form>
</table>
Note that the login button does not have the name.I'm trying to make a function in php for login authentication, whose function is to "isset". Namely, pressing the button the following php code runs: / p>
php code
<?php
$usuario = $_POST['usuario'];
$senha = $_POST['senha'];
$botao = $_POST['é aqui que costumo por o name do botão'];
if (isset($botao)) {
if ($usuario == "" or $senha == "") {
$mensagem = "Campo em branco";
} elseif ($usuario != $_COOKIE['usuario'] or $senha != $_COOKIE['senha']) {
$mensagem = "Usuáriorio ou senha inválido";
} elseif ($usuario == $_COOKIE['usuario'] && $senha == $_COOKIE['senha'] && $_COOKIE['tipo_conta'] == "administrador") {
header("Location:php/administrador.php");
} elseif ($usuario == $_COOKIE['usuario'] && $senha == $_COOKIE['senha'] && $_COOKIE['tipo_conta'] == "registrado") {
header("Location:php/registrado.php");
} elseif ($usuario == $_COOKIE['usuario'] && $senha == $_COOKIE['senha'] && $_COOKIE['tipo_conta'] == "indefinido") {
header("Location:php/indefinido.php");
}
}
?>
The php code is not on the same page that the form is found in. As mentioned earlier, the php code is executed by pressing the button, but for the code to work, it is feasible that it has a name so I can Is there any php code for the "isset" function to work without the need for a name?