I'm looking to use a form to make updating a list on a website quick and simple. Currently I have standard form that just prints out the contents added onto another page, but what I want is to be able to constantly update the page using the form. For example if I use the form to enter my name as John Smith, it will output John Smith, but If I want to add a friends name later, I want it to add their name to the list:
Mike Jones
John Smith
Here is the sample form
<html>
<head><title>Test Page</title></head>
<body>
<h2>Data Collection</h2><p>
<form action="Test2.php" method="post">
<table>
<tr><td>Name:</td><td><input type="text" name="Name" /></td></tr>
<tr><td>Age:</td><td><input type="text" name="Age" /></td></tr>
<tr><td colspan="2" align="center"><input type="submit" /></td></tr>
</table>
</form>
</body>
</html>
And here is the output.
<html>
<head>
</head>
<body>
<?php
print "Your name is ". $Name;
print "<br />";
print "You are ". $Age . " years old";
print "<br />";
?>
</body>
</html>
I was thinking that there needs to be some sort of loops/counter that checks to see if new content was added, but I'm not sure how to go about that.