<input type=text name=name>
<input type=text name=msg>
<input type=submit>
</form>
MSG.PHP
<?php
mysql_connect("localhost", "root", "windows") or
die("Could not connect: " . mysql_error());
mysql_select_db("php");
mysql_query("insert into msg values('$_POST[name]','$_POST[msg]')");
?>
<script language=javascript>
top.location="showmsg.php";
</script>
SHOWMSG.PHP
<?php
mysql_connect("localhost", "root", "windows") or
die("Could not connect: " . mysql_error());
mysql_select_db("php");
$result = mysql_query("select * from msg");
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
echo $row[0].'<br>';
echo $row[1].'<br>';
}
mysql_free_result($result);
?>