(!) Notice: Undefined property: stdClass :: $ documentP in C: \ wamp64 \ www \ mathematchy \ mathematchy \ controller \ logincontroller.php online 48
I submit this error when I try to make another login on my page (localhost)
.
This is my code:
public function profes(){
foreach ($this->model->verificar_credencialesprofes($_REQUEST['documentoP'],$_REQUEST['contrasenaP']) as $key) {
}
if(($_POST['documentoP']==$key->documentoP)&&($_POST['contrasenaP']==$key->contrasenaP)){
$nuevo=new security();
$nuevo->profes($key->usuarioP,$key->documentoP);
$_SESSION['nombre']=$key->usuarioP;
/*header('location: http://localhost/iniciodesesion/?clase=admin&metodo=profes');
*/}
/*else{
echo "<script> alert('El usuario o la contraseña son incorrectas');window.history.go(-1);</script>";
}*/
}
PS: I have commented on the script to visualize the error. Use wamp and MySql. My project is managed by MVC.