How to build?

5 pts.
Tags:
PHP scripts
I have some form mail php code for single file attachment. I want to build it o multiple file upload code. How to do this? this is the code <?php $membertype=ucfirst($_REQUEST["membertype">); $straddress=ucfirst($_REQUEST["straddress">); $strcity=ucfirst($_REQUEST["strcity">); $strstate=ucfirst($_REQUEST["strstate">); $phone=$_REQUEST["strno">; if($phone != ""){ $strno=$phone; } else { $strno="-"; } $stremail=$_REQUEST["stremail">; $strcomments=ucfirst($_REQUEST["strcomments">); $filename=$_FILES["strresume">["name">; $filetype=$_FILES["strresume">["type">; $filesize=$_FILES["strresume">["size">; $filetemp=$_FILES["strresume">["tmp_name">; $filename=$_FILES["strresume2">["name">; $filetype=$_FILES["strresume2">["type">; $filesize=$_FILES["strresume2">["size">; $filetemp=$_FILES["strresume2">["tmp_name">; if($filetype=="image/jpeg" or $filetype=="text/plain" or $filetype=="application/msword") { $message= ' // MAIL SUBJECT $subject = "Mail with image file attachment"; // TO MAIL ADDRESS $to="name@name.com"; /* // MAIL HEADERS $headers = "MIME-Version: 1.0n"; $headers .= "Content-type: text/html; charset=iso-8859-1n"; $headers .= "From: Name <name@name.com>n"; */ // MAIL HEADERS with attachment $fp = fopen($strresume, "rb"); $file = fread($fp, $strresume_size); $file = chunk_split(base64_encode($file)); $num = md5(time()); //Normal headers $headers = "From: Name<name@name.com>rn"; $headers .= "MIME-Version: 1.0rn"; $headers .= "Content-Type: multipart/mixed; "; $headers .= "boundary=".$num."rn"; $headers .= "--$numrn"; // This two steps to help avoid spam $headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">rn"; $headers .= "X-Mailer: PHP v".phpversion()."rn"; // With message $headers .= "Content-Type: text/html; charset=iso-8859-1rn"; $headers .= "Content-Transfer-Encoding: 8bitrn"; $headers .= "".$message."n"; $headers .= "--".$num."n"; // Attachment headers $headers .= "Content-Type:".$strresume_type." "; $headers .= "name="".$strresume_name.""rn"; $headers .= "Content-Transfer-Encoding: base64rn"; $headers .= "Content-Disposition: attachment; "; $headers .= "filename="".$strresume_name.""rnn"; $headers .= "".$file."rn"; $headers .= "--".$num."--"; // SEND MAIL @mail($to, $subject, $message, $headers); fclose($fp); echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#333333; font-weight:bold">Attachment has been sent Successfully.<br /></font>'; } else { echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#F3363F; font-weight:bold">Wrong file format. Mail was not sent.</font>'; //echo "<script>window.location.href='careers.html';</script>"; } ?>

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following