How to clear old FORM data?

liunx

Guest
Hey...<br />
I have this question about FORMs.<br />
Say I have a FORM in index.html, with these settings:<br />
<form method=POST action="index.html"><br />
and I enter info in it, I press submit, and it's on its way where ever, and then im back on index.html again. If I now press Refresh, the browser will ask me if I want to send the information again, or just cancel. How do I get rid of this? I dont want the old data to be resubmitted, I want it be gone... Need to clear it somehow. Can you please help me with this? Regards, Rydberg.<!--content-->With forms you need to make them send the email to you.<br />
<br />
e.g: <br />
<br />
<form action="mailto:[email protected]" method="post"><br />
etc<br />
etc<br />
</form><br />
<br />
That will send the email to your email address.<!--content-->for one the email is not getting sent. nothing is happening when you press submit. the forms action is set to index.html which is not going to do what you want. you have to have the action pointed to an email (like Mr. Tech suggested) or a serverside script that is used to parse the forms data and send it along. this script can be either cgi (perl) or php or asp.<!--content-->I think action=index.html was just a poor example....<br />
<br />
to prevent the "repost from form" message you need to redirect to a "thank you" page that will then go to the index.html page. Just like this forum does when you post a message, first you see a thank you message then you are taken to the page.<!--content-->sigh.. are you sure that's the only way to do it? well, I suppose it's not so terrible.. thanks.<br />
and yeah, action=index.html was just to not make matters more complicated than necessary.. in fact the correct action i have is action="<? getenv("PHP_SELF"); ?>"... the form is for a tiny database driven 'chatbox'..<br />
sorry for the misunderstanding guys, thanks anyway :)<br />
<br />
:rocker:<!--content-->and yeah, action=index.html was just to not make matters more complicated than necessary.. in fact the correct action i have is action="<? getenv("PHP_SELF"); ?>"... <br />
but it makes matters worse as we think you are going to a regular page. it is always best to show the real code so we know what you are working with.<br />
<br />
also don't use getenv as that is primarily for command line operations, plus a bad habit. use $_SERVER["PHP_SELF"] instead.<!--content-->
 
Back
Top