Kapalı

PHP Form Processing Script Enhancement

As you will notice, the code below allows me to enter "known" email addresses in:

$MailToAddress = " ";

$mailHeader = "From: $name rn";

$mailHeader .= "Reply-To: $name rn";

$mailHeader .= "Bcc: $name , , rn";

However, I am interested in having my script modified so that I can also add a "cc" field to any form, thus allowing the person completing the form to manually enter not only their email address, but perhaps three additional addresses as well.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<?php

$MailToAddress = " ";

$redirectURL = " ";

$MailSubject = " ";

$blockip = array("");

$x = count($blockip);

for ($y = 0; $y < $x; $y++) {

if ($REMOTE_ADDR == $blockip[$y]) {

echo ("

------------------------------------------------------ NOTICE! ------------------------------------------------------

Your IP address has been temporarily blocked

-------------------------------------------------- END OF NOTICE ----------------------------------------------------

");

Exit;}

}

if (count($_GET) >0) {

reset($_GET);

while(list($key, $val) = each($_GET)) {

$GLOBALS[$key] = $val;

if (is_array($val)) {

$message .= "$key: ";

foreach ($val as $vala) {

$vala =stripslashes($vala);

$vala = htmlspecialchars($vala);

$message .= "$vala, ";

}

$message .= "nn";

}

else {

$val = stripslashes($val);

if (($key == "Submit") || ($key == "submit")) { }

else { if ($val == "") { $message .= "$key: n"; }

else { $message .= "$key: $valn"; }

}

}

} // end while

}//end if

else {

reset($_POST);

while(list($key, $val) = each($_POST)) {

$GLOBALS[$key] = $val;

if (is_array($val)) {

$message .= "$key: ";

foreach ($val as $vala) {

$vala =stripslashes($vala);

$vala = htmlspecialchars($vala);

$message .= "$vala, ";

}

$message .= "n";

}

else {

$val = stripslashes($val);

if (($key == "Submit") || ($key == "submit")) { }

else { if ($val == "") { $message .= "$key: n"; }

else { $message .= "$key: $valn"; }

}

}

} // end while

}//end else

$what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/n/");

$name = preg_replace($what, "", $name);

$email = preg_replace($what, "", $email);

if (!$email) {$email = $MailToAddress;}

$mailHeader = "From: $name rn";

$mailHeader .= "Reply-To: $name rn";

$mailHeader .= "Bcc: $name , , rn";

$mailMessage .= "$messagern";

$mailMessage .= "rnSenders IP Address: ".getenv('REMOTE_ADDR')."rn";

$mailMessage .= "Unique Message Identifier: [".md5(rand."".time())."]rn";

if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}

else { header("Location: ".$redirectURL);}

?>

Beceriler: Javascript, PHP

Daha fazlasını görün: script address, address script, three form, val , rn, nn, md5, mail script, mail php, globals, exit, error php, enhancement in, email php, email form php script, additional php, form submit php, form mail php, array form, notice, form array, php header script, error sending, php form array, script form address

İşveren Hakkında:
( 43 değerlendirme ) Huntley, United States

Proje NO: #92574

13 freelancer bu iş için ortalamada 52$ teklif veriyor

webexpertz

I am interested.

1 gün içinde 100$ USD
(115 Değerlendirme)
8.6
umairg

Please check your PM!

in 0 gün içinde100$ USD
(58 Değerlendirme)
6.1
jamesghansen

I would appreciate your business and a opportunity to work on your project. Will complete the project to your satisfaction. Thank you for your time.

in 2 gün içinde40$ USD
(11 Değerlendirme)
5.2
palmiere

Please view PMB. Thank you.

in 0 gün içinde30$ USD
(22 Değerlendirme)
5.0
epsilonsoftbd

plz check PM for details

1 gün içinde 40$ USD
(3 Değerlendirme)
4.5
mkader

good day. let me start

in 2 gün içinde40$ USD
(5 Değerlendirme)
3.7
emxtrix

It's yours in half an hour

in 0 gün içinde40$ USD
(4 Değerlendirme)
3.1
lakshminl

Please see your PMB

in 0 gün içinde40$ USD
(2 Değerlendirme)
2.2
marcuspi

I've worked with a variety of different e-mail forms over the years, this is pretty straight-forward.

1 gün içinde 40$ USD
(3 Değerlendirme)
1.3
typn1979

Hello Sir, I can do it for you. Please check PMB. Thanks

1 gün içinde 40$ USD
(1 Değerlendirme)
0.6
alyosha

we have expertise in PHP and java. we are confident of meeting your requirements... please check PMB

in 2 gün içinde50$ USD
(0 Değerlendirme)
0.0
mehedicseewu

we think that we complete this project very easily with in the fixed time. Thank you

1 gün içinde 85$ USD
(0 Değerlendirme)
0.0
cellwings

sir, we have hands-on experience with this work and can deliver best for ur requirements.

1 gün içinde 30$ USD
(0 Değerlendirme)
0.0