Example of mail()
am 28.04.2006 14:59:32 von Renzo Clavijo
--0-686099404-1146229172=:54871
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hi all.
In the code bellow you'll find an easy to use example of mail().
I know it's very simple but the question is: How can I erase the values held in $_REQUEST such that when I press F5 or I click "Reload" there are no messages sent again?
Thanks a lot for your help.
Best Regards
RENZO CLAVIJO
PD: Please forgive me if my english is not OK
---------------------------------
Get amazing travel prices for air and hotel in one click on Yahoo! FareChase
--0-686099404-1146229172=:54871--
Re: Example of mail()
am 30.04.2006 18:34:13 von jusa_98
--0-936663419-1146414853=:51623
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hi,
Why not use cookies to check if the user has pressed F5 or refreshed the page? There is a number of ways to do this, all should work effectively depending on your how many people hit the page etc.
a) Store the message in a cookie, and run PHP code to check before executing the mail() function. If the message matches after a refresh than don't execute the mail() function. You could display the message again in the box or setup a error reporting message saying you cannot refresh the page or send the same message twice.
b) Everytime the page is loaded (whatever.php) from a weblink or something have a hidden field like id=rand() ... Use a random generator to randomly uissue lets say a 12 char legnth. So if the user refreshes the hidden field would be the same hence no mail() execution. However if the page is loaded from a weblink the php issues a new code.
c) I did have a c.. but forgot. Look up the following on google "checksum or chksum"
Anyways. There is more ways but it's time for me to hit the sack(). :P
J
--0-936663419-1146414853=:51623--