Jump to content

brsastre

New Members
  • Posts

    2
  • Joined

  • Last visited

brsastre's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi. I am relatively new to PHP. I'm trying to make a user authentication, and sending the user to another page if succeeded, with the following code: <?php include ('../conexion.php'); $nombreUsuario = $_POST['nombreusuario']; $password = $_POST['password']; var_dump($nombreUsuario); var_dump($password); $consultaAdmin= "SELECT * FROM usuarios WHERE nombre_usuario = '$nombreUsuario' AND password = '$password' AND tipo = 'admin'"; $resultadoAdmin = mysqli_query($conn , $consultaAdmin); $cantidad= mysqli_num_rows($resultadoAdmin); if($cantidad==1) { header("location:listado_recetas.php?bienvenida=si"); }else { header("location:index.php?error=si"); } ?> I am getting this error: string( "brsastre" string(10) "igor123123" Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/recetario/admin/validar.php:7)... If I remove var_dump's it works just fine. Why is this happening?
  2. What is a 'getter context'? "PHP invokes the __get() method if a property is undefined (or inaccessible) and called in a getter context. The method accepts one argument, the name of the property. It should return a value which is treated as the value of the property."
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.