Lukket

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

?>

Færdigheder: Javascript, PHP

Se mere: 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

Om arbejdsgiveren:
( 43 bedømmelser ) Huntley, United States

Projekt-ID: #92574

13 freelancere byder i gennemsnit $52 for dette job

webexpertz

I am interested.

$100 USD på 1 dag
(115 bedømmelser)
8.6
umairg

Please check your PM!

$100 USD in 0 dage
(58 bedømmelser)
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 in 2 dage
(11 bedømmelser)
5.2
palmiere

Please view PMB. Thank you.

$30 USD in 0 dage
(22 bedømmelser)
5.0
epsilonsoftbd

plz check PM for details

$40 USD på 1 dag
(3 bedømmelser)
4.5
mkader

good day. let me start

$40 USD in 2 dage
(5 bedømmelser)
3.7
emxtrix

It's yours in half an hour

$40 USD in 0 dage
(4 bedømmelser)
3.1
lakshminl

Please see your PMB

$40 USD in 0 dage
(2 bedømmelser)
2.2
marcuspi

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

$40 USD på 1 dag
(3 bedømmelser)
1.3
typn1979

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

$40 USD på 1 dag
(1 bedømmelse)
0.6
alyosha

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

$50 USD in 2 dage
(0 bedømmelser)
0.0
mehedicseewu

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

$85 USD på 1 dag
(0 bedømmelser)
0.0
cellwings

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

$30 USD på 1 dag
(0 bedømmelser)
0.0