Encontré este código de contraseña para acceder a una página restringida, y al ir a probarlo resulta que tras poner la contraseña sólo veo la página de destino, pero vacía. Si alguien ve un error en el código, le agradecería que me dijese cuál es.
El código es el siguiente:
<html>
<head>
<title>esto</title>
</head>
<body>
<form action="pagina1.php" method="post">
Clave de acceso:<input type="password" name="acceso" size="14">
<input type="submit" value="Entrar">
</form>
</body>
</html>
<?php
$acceso = $_POST["acceso"];
if ($acceso <> campanilla) {
echo " <html>
<head>
<title>Aviso</title>
</head>
<body>
Acceso denegado, vuelve a intentarlo
</body>
</html>";
}else{
echo "<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transitional.dtd">
<html xmlns="http://wwww.w3.org/1999/xhtml">
<head>
<title>pagina2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Robots" content="noindex, nofollow" />
<style type="text/css">
* {
margin:0;
padding:0;
border: 0;
position: relative;
}
body {
background: black;
margin: 0 auto;
text-align: center;
}
#contenido {
width: 650px;
position: relative;
background: white;
padding-top: 40px;
}
h2 {
font: normal, 14px Arial, sans-serif;
text-align: center;
color: green;
}
</style>
</head>
<body>
<center>
<div id="contenido">
[contenido no disponible]</img></p>
<h2>Bienven ido a la página 2</h2>
</div>
</body>
</html>
}
?>
¿Hay algo equivocado por ahí?
:roll:
El código es el siguiente:
<html>
<head>
<title>esto</title>
</head>
<body>
<form action="pagina1.php" method="post">
Clave de acceso:<input type="password" name="acceso" size="14">
<input type="submit" value="Entrar">
</form>
</body>
</html>
<?php
$acceso = $_POST["acceso"];
if ($acceso <> campanilla) {
echo " <html>
<head>
<title>Aviso</title>
</head>
<body>
Acceso denegado, vuelve a intentarlo
</body>
</html>";
}else{
echo "<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transitional.dtd">
<html xmlns="http://wwww.w3.org/1999/xhtml">
<head>
<title>pagina2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Robots" content="noindex, nofollow" />
<style type="text/css">
* {
margin:0;
padding:0;
border: 0;
position: relative;
}
body {
background: black;
margin: 0 auto;
text-align: center;
}
#contenido {
width: 650px;
position: relative;
background: white;
padding-top: 40px;
}
h2 {
font: normal, 14px Arial, sans-serif;
text-align: center;
color: green;
}
</style>
</head>
<body>
<center>
<div id="contenido">
[contenido no disponible]</img></p>
<h2>Bienven ido a la página 2</h2>
</div>
</body>
</html>
}
?>
¿Hay algo equivocado por ahí?
:roll: