Floortje wrote:
"chris" <so*****@here.com> schreef in bericht
news:3f********@funnel.arach.net.au... is there a way in either php or html to disable the back and or the
reload/refresh on a browser so a potential spammer cant just keep
refreshing the page of a form that sends a confirmation email out
You could use uniqid() to generate a unique id and include it in hidden field in
the form. On your confirmation page, check a log file or mysql db to see if
that confirmation number has been used. If not, send the email and write the id
to the db or file. If it has been used, display the appropriate error message.
This is quick and easy and will prevent the casual or inadvertent "spammer" from
sending multiple emails with refresh and back (though a programmer can get
around it easily). Make sure to clean out the file or db often or else your
script will slow down. You can do this manually, with a cron job, or this
method:
If using a logfile, if the filesize() is greater than n bytes delete all but the
last 10 records and save the file. Occasionally, a user will have to wait a bit
longer (a fraction of a second or, at most, a couple seconds), but you keep all
your code together.
Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com http://www.glassgiant.com