I've recently got into the new world of php and html programming in the "form" sections. I've put together a code that will submit and create a page with a table that includes specified information from textboxes and such, I'm having a problem creating a reset button because the first form in my page allways seems to conflict in the new form that I make, or new button that I make to send different information to the same page. The main problem may because I want to access all the control from just one page. I have 4 pages; the main.php, the action3.php, the user3.php, and the style.css. Mainly all the programming of submission is in the action3.php which looks like this:
<form method=post>
<center>Name: <input type="text" name="user"><br>
<center><textarea name=comment>Post a comment to the site.</textarea><br>
<center><input type="submit" name="Submit" value="Post Comment" action=
<?php
$username = $POST['user'];
$comment = $POST['comment'];
$def = "<td>$username $comment</td><tr>\n";
$daf = $username;
if ( $daf == "reset form" ) {
$daf = "<html><body bgcolor=white><center><font size=4><b>This is my first dynamic posting board.</b><br><br><table border=1 rows=1><tr><td><b>Username |<b> Comment</td></tr>";
$aol = "w";
} else {
$daf = $def;
$aol = "a";
}
$f = fopen("user3.php", "$aol");
fwrite($f, $daf);
fclose($f);
?>></form>
Than the main page looks like this
<head><title>Entity Servers</title><link rel="stylesheet" type="text/css" href="style.css"/></head>
<center>
<table border=0><tr><td>
<?php include("user3.php") ?></td></tr><td>
<?php include("action3.php") ?>
<br>
<a href=main.php>Refresh view of all Comments.</a><br>
<center>Entity Servers All rights Reserved.
</td></tr></table><br><br>
</html>
~~~~~~~~~
You can tell what the user3.php page consists of because it's in the action3.php
in the entity of the "reset" script that I tried to make, but only succeeded by making it like a password, or administer right. I want the reset to be a button so that anyone can reset the form. You might want to know why, but that reason is just for experimental purposes. I would greatly appreaciate any help I can get.
THANK YOU!