How do I get information coming from POST of the form, so that this data enters a decision structure, Example: I have an abstract class with the function of entering the system, however in the form the user has to check if it is employee, or deliverer, the class that inherits the method to enter first needs to know whether this login is the employee of the company or the deliverer, as both will be directed to different screens.
PAGINA INDEX, NÃO COLOQUEI O FORMULARIO PARA NÃO FICAR EXTENSO DEMAIS.
require_once 'Log.php';
$ logando = new Login ($ user, $ password); $ logando -> setUsuario ($ _ POST ['user']); $ logando-> setSenha ($ _ POST ['password']);
LOGIN PAGE:
public function __construct($usuario, $senha) {
$this->usuario = $usuario;
$this->senha = $senha;
}
function getUsuario() {
return $this->usuario;
}
function getSenha() {
return $this->senha;
}
function setUsuario($usuario) {
$this->usuario = $usuario;
}
function setSenha($senha) {
$this->senha = $senha;
}
abstract public function Entrar($usuario, $senha);
abstract public function Sair();
abstract public function Erro();
}
HOME PAGE
class Logar extends Login {
private $con;
public function __construct($usuario, $senha) {
parent::__construct($usuario, $senha);
$this->con = new Conexao();
}
public function Entrar($usuario, $senha) {
parent::Entrar($usuario, $senha);
echo "Método entrar esta funcionando";
}
public function Sair(){
echo "Saindo";
}
public function Erro() {
echo "Erro";
}
}