Código HTML:
<form action="comentar.php" method="get"><textarea name="comentario" id="comentario" cols="95" rows="5"></textarea><br /><center><input name="button" type="submit" style=";border: #FFFFF 1px dashed; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; text-align: center; width: 128; height: 30; background-color:#009933; font-weight: bold" value="Enviar comentario"></center></form>
Código PHP:
<?
include("config.php");
include("login.php");
include("pfvariables.php");
include("redimensionar.php");
$rs = mysql_query("select * from posts WHERE id='".$_GET['id']."'");
$result = mysql_fetch_array($rs);
$result[id]=$id;
?>
<center><strong>
<?
if($_GET[comentario]=="") {
echo "Debes escribir algo para enviar un comentario";
exit;
}
else
{
mysql_query("insert into comentarios (comentario, fecha, id_post, id) values ('$_GET[comentario]', now(), '$id')");
echo "Comentario agregado!!";
}
?>
</center></strong>
Bueno espero que me puedan ayudar , un abrazo :)