Hola,
tengo un pequeño problema con mi código PHP y las Cookies que genera.
El código es el siguiente:
Código PHP:
<?php
if(empty($_POST['pass'])) {
echo '<form id="form1" name="form1" method="post" action="">
Clave:
<input type="password" name="pass" />
<p>
<input type="submit" name="send" value="Enviar" />
</p>
</form>';
}else{
if($_POST['pass']=="54322") {
setcookie("autorization", "YES", time()+3600);
?>
<meta http-equiv="acción" content="1"; url="acp.php" />
<?php
}else{
?>
<meta http-equiv="acción" content="1"; url="../index.php" />
<?php
}
}
?>
Pero cuando meto la contraseña en el form y le doy al botón, me salta el siguiente error:
Warning: Cannot modify header information - headers already sent by (output started at /home/d414918/public_html/papa2/index.php:7) in /home/d414918/public_html/papa2/index.php on line 30
¿Cómo puedo arreglarlo?
Saludos!