Topic: More problems with Mail ()

More problems with Mail ()
I have a form with some fields on my client site.
For the time being, I used my own email, if the user check the form and fill it, all the email data comes to my inbox.
But I received some marketing emails in my inbox and used the email address of that site.
my code is:



<?php 
$to = "123@yahoo.com"; 
$url = "ACD - Contact Form"; 
$subject = $_REQUEST['subj'] ; 
$org = $_REQUEST['org'] ; 
$tele = $_REQUEST['tele'] ; 
$city = $_REQUEST['city'] ; 
$email = $_REQUEST['email'] ; 
$message = $_REQUEST['message'] ; 

$details = "URL - Form : $url\n
            Subject: $subject\n
            Organization: $org\n
            Telephone: $tele\n
            City: $city\n
            From: $email \n
            Message: $message \n
        ";

$headers = "From: $email"; 
$sent = mail($to, $subject, $details, $headers, $message) ; 
if($sent) 
{print "Your mail was sent successfully"; }
else 
{print "We encountered an error sending your mail"; }
?> 


How can I get rid of it?

Vote up Vote down

Re: More problems with Mail ()

try adding a Captcha to the form and script.
Google it.

My signature goes here --> X

Vote up Vote down

Re: More problems with Mail ()

Also consider doing a search for "securing a contact form" or similar...  Here are a couple articles:

http://f6design.com/journal/2006/12/09/ … act-forms/
http://www.phpnerds.com/article/buildin … ntact-form
http://net.tutsplus.com/tutorials/php/b … tact-form/

Benjamin Falk | Falken Creative : Twitter
Skills: Photoshop, Illustrator, HTML, CSS, jQuery, PHP and CodeIgniter

Vote up Vote down