Jump to content

PHP form secure


Rickzkm

Recommended Posts

Hello There,

I have php submit form and im getting quite few blank emails in. I was wondering if anyone could help me secure this form. Im new to php and this forum and i am open to any suggestions.

Code:
<?
require "emailtemplate.php";
function SendMail($for = "", $subject = "", $text = "", $email="")
{
$text = StrTr($text, "\x8A\x8D\x8E\x9A\x9D\x9E",
"\xA9\xAB\xAE\xB9\xBB\xBE");
$headers= "From: $email\nMIME-Version: 1.0\nContent-Type: text/html; charset=\"iso-8859-1\"\n";
$headers .= "X-Sender: <"; $headers .= $email; $headers .= ">\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Priority: 1\n";
$headers .= "Return-Path: <"; $headers .= $email; $headers .= ">\n";
if (!@Mail($for, $subject, $text, $headers)) {return false;}
return true;
}
if (SendMail("onlineorders@mydomain.com,".$youremail."", "Order - Send from IP adress: $REMOTE_ADDR", $mailbody, "onlineordersmydomain.com"))
echo "<br>Your order has been sent to mydomain and a copy of your order has been sent to your email address.<br>";
else
echo "<br>Your order has not been sent to mydomain - transfer failed.<br>";

?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.