View Single Post
Old Aug 15th, 2007, 10:06 PM   #4
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
To answer your question, you can use the unset function. Whether the data will be automatically resubmitted when the page is refreshed is browser-depended; in my browser (Safari on Mac OS X) it is not.

Your form should have an action attribute; you can set it to the name of the current page to replicate the current behavior:

<form method="post" action="filename.php" name="nameform">
Note that your form should also have a name attribute ("nameform" in the example above) to facilitate scripting.

Also note that the <font> tag is deprecated (use <div> or <span> instead). Additionally, you should close all tags, even those that do not require separate closing tags; for example:

<input type="submit" value="submit" />
Finally, you should check whether the form has been submit before printing a failure or success message by using the isset function; similarly, you may not want to display the form if the name is successfully found in the "database".

Last edited by titaniumdecoy; Aug 15th, 2007 at 10:27 PM.
titaniumdecoy is offline   Reply With Quote