-1
Below the code I have to collect the $_POST
<?php
$conexao = mysql_connect("localhost:3306",'user1','senhadementirinha');
$bd = mysql_select_db("recados");
?>
<form name="form" method="post" action="#">
Nome:
<input type=text name=nome><br><br>
E-Mail:
<input type=text name=email><br><br>
Mensagem:
<textarea name=post></textarea><br><br>
<input type=submit value=Enviar>
<input type=reset value=Limpar>
</form>
<?php
$nome=$_POST['nome'];
$post=$_POST['post'];
$data = date("Y/m/d");
$insert = mysql_query("INSERT INTO msg(nome,post,data) values ('$nome','$post','$date')");
$sql = "SELECT * FROM msg ORDER BY id desc";
$executar = mysql_query($sql);
while( $exibir = mysql_fetch_array($executar)){
echo $exibir['date'];
echo $exibir['post'];
echo "</br><hr>";
}
?>
this code is used in loop in a table, but I was able to insert and place the comment in the table row, but when it updates, the other rows send to the database empty spaces.
One way to solve would be to have a checkbox but I do not know if it is possible after selected, it remain even after updating the page.
My complicated understand your doubt, but I think this is it: checks if there is a Session, if there is no Insert and creates a Session after the Insert.
– user60252