el codio original del prefabricado es este
Código PHP:
<html>
<head>
<title>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 exito!</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 ó 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 "<center><font face='Arial' size='2'><b>Identificate :</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></center>";
}
?>
</body>
</html>
gracias y Feliz navidad.