Ditutup

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);}

?>

Kemahiran: Javascript, PHP

Lihat lebih lanjut: script ip address, ip address script, three form, val , rn, nn, md5, mail script, mail php, GLOBALS, exit, error php, enhancement in, email php, email form php script, e mail processing, additional php, form submit php, field php, form mail php, javascript submit form email address, array form, notice, form array, php header script

Tentang Majikan:
( 43 ulasan ) Huntley, United States

ID Projek: #92574

12 pekerja bebas membida secara purata $53 untuk pekerjaan ini

webexpertz

I am interested.

$100 USD dalam sehari
(120 Ulasan)
8.6
umairg

Please check your PM!

$100 USD dalam 0 hari
(58 Ulasan)
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.

$40 USD dalam 2 hari
(11 Ulasan)
5.2
palmiere

Please view PMB. Thank you.

$30 USD dalam 0 hari
(22 Ulasan)
5.0
epsilonsoftbd

plz check PM for details

$40 USD dalam sehari
(3 Ulasan)
4.5
mkader

good day. let me start

$40 USD dalam 2 hari
(5 Ulasan)
3.7
lakshminl

Please see your PMB

$40 USD dalam 0 hari
(2 Ulasan)
2.2
marcuspi

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

$40 USD dalam sehari
(3 Ulasan)
1.3
typn1979

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

$40 USD dalam sehari
(1 Ulasan)
0.6
alyosha

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

$50 USD dalam 2 hari
(0 Ulasan)
0.0
mehedicseewu

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

$85 USD dalam sehari
(0 Ulasan)
0.0
cellwings

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

$30 USD dalam sehari
(0 Ulasan)
0.0