Click to See Complete Forum and Search --> : pyro's script


slim
08-20-2003, 06:49 PM
hi folks I was having trouble with a mailer and was given this link by pyro. This script works well in fack too well unfortunatly this mail script is open to spamm from remote servers.

so my question is this how can I make this script so that it only send email requests from the server it is hosted on or a specific server ?? thanks..


http://www.webdevfaqs.com/php.php#mailer

pyro
08-20-2003, 09:07 PM
Wrap something like this around it, though referrer strings can be faked...

if (preg_match("/http:\\/\\/www\\.yourdomain\\.com\\//",$_SERVER["HTTP_REFERER"])) {
#mailer code here
}That will make sure it fine http://www.yourdomain.com in the referrer string...

Also, I don't think this is a big issue, as the script can only be mailed back to the email address specified in the script...

slim
08-21-2003, 06:21 AM
Ahh I seen to have overlooked that :confused: hehe I willl try to add the code anyhow and once again thank you.

pyro
08-21-2003, 06:59 AM
You bet... :)