Forum Moderators: coopster
I'm totally new to PHP and already stuck. I'm trying to simply have a form where someone can enter their email. Then I would like to save all emails entered into a CSV file. I thought I would find hundreds of examples of doing this but maybe I'm just not searching for the right thing. Can someone either help or point me in the right direction please. One additional function I would like to have is to check to make sure a certain IP can submit only once, which I gather it's possible but how. And any other simple methods to make sure spammers don't abuse it.
Thank you so much.
Miro
If you wanna check IPs, you need to append to two different files then - emails to one, and senders' IP addresses to another. Then you'll know who has already submitted stuff.
Then add a checking routine before writing to files: read the IPs file ( file_get_contents [php.net] may be a good thing for that: ) and look for the current IP ( for example, with strpos [php.net] ). Proceed only if you don't find it.
Hope you'll find your way :) PHP is a good thing, you'll like it :)
[edited by: Otaku at 10:56 am (utc) on May 5, 2008]
One thing I wonder. What happens when more than one person is handling the form? It doesn't cause conflict? I thought maybe it would since fopen, fclose happening at the same time for different things to write. (sorry i'm not asking this question more pro but i hope you get what i'm saying) :)
'Had