
04/11/2003, 13:48
|
| | Fecha de Ingreso: octubre-2003 Ubicación: Madrid
Mensajes: 320
Antigüedad: 21 años, 3 meses Puntos: 0 | |
Estoy tratando de configurar el Kike PHP, que es el que me ha parecido más fácil de los dos.
Sólo me ha surgido un problema (de momento): no puedo acceder al panel de administración porque no conozco el nombre de usuario ni la clave, y no veo que me los indique por ningún sitio, simplemente, me dice que edite el código del fichero correspondiente:
<html>
<head>
<title>Panel de Administración</title>
<link rel="stylesheet" type="text/css" href="html/estilo.css">
</head>
<body>
<?
include("config.php");
switch($accion) {
case panel:
if($NombreAdmin == $user AND $ContraseñaAdmin == $pass) {
if($idmensaje) {
$Base = file($FicheroBase);
for ($i = 0; $i < count($Base); $i++) {
$dato = explode("|@|", $Base[$i]);
if ($dato[0] == $idmensaje) {
$Base[$i] = "";
$fp = fopen("$FicheroBase", "w+");
for ($i = 0; $i < count($Base); $i++) {
fwrite($fp, $Base[$i]);
}
fclose($fp);
echo "<p align='center'>";
echo "<font face='Arial' size='4'><b>¡El mensaje se ha eliminado con éxito!</b></font>";
echo "<br><form name='form' action='admin.php' method='post'>";
echo "<input type='hidden' name='accion' value='panel'>";
echo "<input type='hidden' name='user' value='$user'>";
echo "<input type='hidden' name='pass' value='$pass'>";
echo "<input type='submit' value='Volver' class='formulario'>";
echo "</form></p>";
}
}
} else {
echo "<font face='Arial' size='2'><b>Borrar un mensaje:</b></font><p>";
echo "<form action='admin.php' method='post'>";
echo "<input type='hidden' name='accion' value='panel'>";
echo "<input type='hidden' name='user' value='$user'>";
echo "<input type='hidden' name='pass' value='$pass'>";
echo "<font face='Arial' size='2'>Número de mensaje :</font><br>";
echo "<input type='text' name='idmensaje' size='20' class='formulario'><p>";
echo "<input type='submit' value='Borrar' class='formulario'>";
echo "</form><hr size='1' width='300' noshade><p>";
echo "<table width='500' cellspacing='4' align='center' style='font-family: Verdana; font-size: 11px'>";
$Base = file($FicheroBase);
for ($i = 0; $i < count($Base); $i++) {
$dato = explode("|@|", $Base[$i]);
$dato[4] = str_replace("<br>", " - ", $dato[4]);
echo "<tr><td width='200'><b>Número de mensaje:</b> $dato[0]</font></td>";
echo "<td width='300'><br>$dato[4]</td></tr>";
}
echo "<table>";
}
} else {
echo "<p align='center'>";
echo "<font face='Arial' size='4'><b>Nombre o contraseña incorrecta.</b></font>";
echo "<br><form name='form' action='admin.php' method='post'>";
echo "<input type='submit' value='Volver' class='formulario'>";
echo "</form></p>";
}
break;
default:
echo "<font face='Arial' size='2'><b>Identifícate:</b><font><p>";
echo "<form name='form' action='admin.php' method='post'>";
echo "<input type='hidden' name='accion' value='panel'>";
echo "<font face='Arial' size='2'>Nombre:</font><br>";
echo "<input type='text' name='user' size='20' class='formulario'><br>";
echo "<font face='Arial' size='2'>Contraseña:</font><br>";
echo "<input type='password' name='pass' size='20' class='formulario'><p>";
echo "<input type='submit' value='Entrar' class='formulario'></form><p>";
echo "<font face='Arial' size='2'><a href='index.php'>Volver</a></font>";
}
?>
</body>
</html>
¿Qué debo hacer? |