Here is one of the examples a tried:
1. The conectdb.php page:
<?php
$hostname = "localhost";
$banco = "novateste";
$username = "root";
$senha = "ustm";
$dbconn = mysql_connect($hostname, $username, $senha);
mysql_select_db($banco, $dbconn);
?>
2. The html form page:
<html>
<head>
<title>Formulário para inserir no BD</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="inserindo.php" method="post" name="mural" id="mural">
<table width="450" border="0" cellspacing="0" cellpading="3">
<tr>
<td widht="111"><div align="right">Nome:</div></td>
<td widht="339"><input name="nome" type="text" id="nome" size="30"></td>
</tr>
<tr>
<td valign="top"><div align="right">Mensagem:</div></td>
<td><textarea name="mensagem" cols="30" rows="10" id="mensagem"></textarea></td>
</tr>
<tr>
<td height="29" colspan="2" valign="top"><div align="center">
<input type="submit" name="submit" value="Inserir no banco de dados">
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
3. The inserindo.php page:
<html>
<head>
<title>inserir no BD</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php require('conectdb.php'); ?>
<?php
$data = date('d-m-Y');
$hora = strftime("%H:%M:%S");
$sqlinsert = "INSERT INTO tb_mural (id_mensagem, nome, mensagem, data, hora)
VALUES ('','$nome', '$mensagem', '$data', '$hora')";
mysql_query($sqlinsert, $dbconn) or die("Nao foi possivel inserir");
echo "Na data $data e na hora $hora<br>$nome disse:<br>$mensagem";
?>
</body>
</html>
4. I fill the text and textarea and submit. Here is what I get in the returned page:
Na data 09-10-2006 e na hora 21:48:14
Disse:
5. I check the tb_mural, I find that fields “mensagem” and “nome” are empty; other fields have correct values.