PHP Chat Box and Form Help?

Hello. I am currently trying to make a system using PHP where my members will fill out a form, submit the form, and whatever they submit will show up on the web page. It is sort of like a chat room. Here is the code I am currently using:

<html>
<head>
<title>
PHP Tests
</title>
</head>

<body>

<table border=3px width=900px height=20px align="center">

<tr>

<td>

<div align="center">

<?php

echo $_POST ['user'];

?>

</div>

</td>

<td>

<div align="center">

<?php

echo $_POST ['comment'];

?>

<br>
<br>


</div>

</td>

</tr>

</table>

<br>
<br>

<div align="center">

<?php

$form =

"
<table border=0px>
<tr>
<td>
<form action='output.php' method='post'>

Username:<input type ='text' name='user'><br>
Comment:<input type='text' name='comment'><br>
<input type='submit' value='Submit'>

</form>

</td>
</tr>
</table>

";

echo $form;

?>

</div>

</body>
</html>


The problem that I am having is that when the user submits the post, it shows up on the screen, but when another user sumbits their information, the previous users information goes away. What I want it to do is I want the user to submit their user name and comment, it shows up on the screen in a table with the username to the left and the comment that the user submitted to the right, and I want it to stay there so when another person fills out the form and submits it, their information will be processed write below what the previous person submitted. Please help me... i am new to PHP coding and I just want to make a simple comment box without having a mysql database or having users create an account or anything like that.
 
Back
Top