Bundles

 

Disable an entire form

Nandhu
2008-05-06 09:35:35
Disable an entire form
I've got a link, and wen i click on it, a new php file which contains a form appears...
This form i fill it up and click the submit button, and wen i do it, all ma details are stored in the database.

Next time wen i try to fill the same form and wen i try to send it by clicking the submit button.... nothing shud happen...

i.e. Only once that form cud be filled and sent....

I have two php files.... One is form.php, in which i have the coding for form design and the other if formappln.php, which is the application file.

Can u help me out....
Veselin
2008-05-06 10:54:21
Re:
you need to use some IP or Cookie protection first to prevent people submitting the form twice. When they first submit the form you can put a cookie and next time they open the page you can check if cooke exists and if it's there do not show the form at all.
Nandhu
2008-05-06 11:10:52
Re:
I think i follow you...
Still, cud you be more ellaborate....
I mean, give me some egs...
Veselin
2008-05-06 22:27:18
Re:
do you know how to create cookies using PHP?
Nandhu
2008-05-07 10:36:09
Re:
No i dont know how to create cookies... I've used only session...
Alin
2008-05-09 19:08:32
Re:
The function is setcookie()
An example would be:
setcookie("form", "some value", time()+2678400);
This will set the cookie that expires in one month. That line must be like session_start(), before outputing any text.

To check for the cookie, you can use if(isset($_COOKIE['form'])).
You can read more information about that function on http://www.php.net/setcookie
Reply
Title:
Your name:
Your email: (email address will not be posted on the web site)
Reply:
Verification