Page 1 of 1

capture ip in php form/add cookie to avoid multiple submit?

Posted: Mon Aug 11, 2008 6:20 am
by pennytrader
HI, im using phpfprmgenerator to create an html form. the application was part of fantastico.

Anyway, i want to add a cookie which would allow the user to reply to the form only once. not more than than once.

The html and php files are attached as below. pls tell me what code i could use and where it needs to be inserted. Thanks a lot for your time.

html file: http://www.pbmumbai.com
php file. http://www.pbmumbai.com/process.zip

if not the cookies, can anyone give me a code i could use to capture their ip, and store it in the mysql db?

Re: capture ip in php form/add cookie to avoid multiple submit?

Posted: Mon Aug 11, 2008 8:47 am
by dajawu
When I made a quick poll online that I wanted people to only vote once, I did something like this. It has some holes but no matter how hard you try someone can always find away to vote twice, unless you have them sign up for accounts. I'm sure others here can help you more, but this is what I did.

I had an SQL table that when someone voted would record there name, the votes, the time they voted, and their IP address. If I see there IP address is already in the table then I wont tally their vote. To see someones IP address it is as easy as using the variable:

$_SERVER['REMOTE_ADDR'];