Hola a todos, mi problema es que estoy haciendo un tagboard y quiero que el ultimo comentario se vea mas arriba, normalmente el ultimo comentario se graba en la parte de abajo del tag pero quiero hacerlo al reves, ahhh y quiero que no utilizen como nombre una determinada palabra como por ejemplo "administrador".
Aqui el codigo
Gracias de antemano por la respuesta
Código PHP:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="es-pe" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Prueba de tagboard</title>
</head>
<body>
<table cellpadding="0" cellspacing="0" style="width: 859px; height: 440px">
<tr>
<td style="height: 339px; width: 337px">Prueba de tagboard</td>
<td style="height: 339px">tag
<table width="50%" height="50%">
<form action="prueba2.php" method="post">
Nombre:
<br>
<input name="name" type="text" size="30">
<br>
Comentario:
<br>
<textarea cols="30" name="comment"> </textarea>
<br>
<input type="submit" value="Enviar">
</form>
<?php
$file = "comentarios.txt";//archivo
function form_validate () {
if (sizeof($_POST) < 1) return false;
foreach ($_POST as $name => $value) {
return false;
}
}
return true;
}
function blank_replace ($str) {
}
function stick_escape ($str) {
}
if (form_validate()) {
$fp = fopen ($file,"at"); fwrite ($fp,uniqid(rand(),true)."\t".blank_replace
($_POST['name'])."\t".blank_replace
($_POST['comment'])."\n"); }
echo "No hay comentarios";
} else {
while ($info = fscanf ($fp,"%s\n%s\n%s\n\n")) { list ($id,$name,$comment) = $info; ?>
<table border="0" width="47%">
<tr>
<td width="26%"><b>Nombre:</b> </td>
<td width="74%"><?=stick_escape($name)?></td>
</tr>
<tr>
<td width="26%"><b>Comentario:</b></td>
<td width="74%"><?=stick_escape($comment)?></td>
</tr>
</table>
<br>
<?php
}
}
?>
<hr>
</body>
</html>