Jump to content

Sherio

New Members
  • Posts

    4
  • Joined

  • Last visited

Sherio's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you, phppup. I have no clue how to spam myself, nor would I ask you to put it out there for the whole world to see. 🙂 I'll do as you suggested.
  2. That's not quite the type of guidance I was hoping for. 🙂 Have a great day!
  3. ginergm and mac_gyver, Thanks for your suggestions! Alas, I know nothing about php yet. Can you guide me further?
  4. The script tied to my contact form worked flawlessly for several years. Suddenly, I am receiving spam. Although I created a new email address for this purpose, it started getting spam within 24 hours. Can I protect the script somehow? <?php if (isset($_POST['submit'])) { $post = true; $sender = $_POST['SenderName']; $email = $_POST['SenderEmail']; $subject = stripslashes(trim($_POST['Subject'])); $text = stripslashes(trim($_POST['MessageText'])); if (!strpos($email, '@') || !strpos($email, '.')) { $fail = "Reason: Please enter your valid return email address"; } elseif (strlen(trim($text)) == 0) { $fail = "Reason: You did not type in a message"; } else { $text = nl2br(htmlentities(trim($text),ENT_QUOTES,"",false)); $sender = "\"$sender\" <$email>"; $subject = "inquiry"; $m_email = 'meow@meow.com'; $head = "<html><head><title>inquiry</title></head><body>"; $tail = "</body></html>"; $text = $head.$text.$tail; $headers = ''; $headers .= "From: $sender\r\n"; $headers .= "Reply-to: $email\r\n"; $headers .= "Return-path: $email\r\n"; $headers .= 'Envelope-from: auto@meow.com'."\r\n"; $headers .= 'MIME-Version:1.0'."\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n"; $mail_sent = mail($m_email, $subject, $text, $headers, "-f auto@meow.com"); if ($mail_sent == false) $fail = 'Server Error: Email could not be sent at this time.'; } if ($fail) { echo "<div id=\"mail_send_msg\"><h2>Sorry, your message could not be sent.<br />$fail</h2></div>\n"; } else { echo "<div id=\"mail_send_msg\"><h2>Your email message has been sent!</h2></div>\n"; } } else { echo "POST not recognized."; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.