libro.php
Código php:
Ver original<?
include("config.php");
include("funciones.php");
Template("htmll/tpl_arriba.html"); ?>
<table width="650" border="2" align="center" cellpadding="3" bordercolor="#FFCCFF" style="border-collapse:collapse">
<tr>
<td><br />
<?
switch($_REQUEST['accion']) {
case "firmar":
Template("htmll/tpl_formulario.html");
break;
case "publicar":
$fecha = date("d-m-y H:i a");
$mensaje = trim($mensaje);
$error[] = $alerta[0];
}
if($email != "") {
if (!ereg("^[^@]+@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,}$", $email)) { $error[] = $alerta[1];
}
}
$error[] = $alerta[2];
}
if($FiltroGroserias == "SI") {
for($i = 0; $i < sizeof($palabrotas); $i++) { if(ereg($palabrotas[$i], $nombre) OR
ereg($palabrotas[$i], $email) OR
ereg($palabrotas[$i], $mensaje)) { $error[] = $alerta[3];
}
}
}
if($error) {
include("htmll/tpl_formulario.html");
} else {
HTML();
Remplazar();
$fp = fopen($FicheroId,"r"); $id ++;
$fp = fopen($FicheroId, "w");
$firma = "$id|@|$nombre|@|$email|@|$url|@|$mensaje|@|$fecha|@|\n";
$fp = fopen($FicheroBase, "a");
Template("htmll/tpl_correcto.html");
}
break;
default:
// Mostrar todas las firmas
$Base = file($FicheroBase);
$paginado = 0;
}
$Mostrar = $paginado + $LimiteMensajes;
for ($i = $paginado; $i < count($Orden) AND
$i < $Mostrar; $i++) { $dato = explode("|@|", $Orden[$i]);
$nombre = $dato[1];
$email = $dato[2];
$mensaje = $dato[4];
$fecha = $dato[5];
// Template
Template("htmll/tpl_mensajes.html");
}
echo "<table cellpadding='4' cellspacing='1' width='450' align='center' class='normal'>";
echo "<tr><td width='50%'>";
Paginacion();
echo "</td><td width='50%' align='right'>";
echo "<b><a href='libro.php?accion=firmar'>Firmar...</a></b>";
echo "</td></tr></table>";
}
?>