Jump to content

(help!) 3D PHP Form-Mailer


tandoorimix

Recommended Posts

Hi. I'm using a php script called 'Dr Snaps 3D PHP Form-Mailer' which allows site visitors to email files to me. However, they can only send 1 file. I would like to add several more file upload fields to the form but am unsure how. The links to the scripts owners don't appear to be working anymore. You can download the original script from here... http://www.hair-heads.co.uk/3dFileFormMailerHTML4.zip

 

I've tried just adding another file form field with the same name but I guessed it wouldn't work... and it didn't!

 

I maybe wrong but I think this is the bit of script that needs to be edited to allow more than one file to be uploaded. Any help would be greatly appreciated.

 

$form_fields=array_keys($HTTP_POST_VARS);$temp="Sender's IP Address: ".$_SERVER['REMOTE_ADDR']."\n";while($field = array_pop($form_fields)){$temp.="$field: $HTTP_POST_VARS[$field]\n";}$to=$_POST['To'];$from=$_POST['Email'];$message=$temp;$fileatt=$_FILES['File']['tmp_name'];$fileatt_type=$_FILES['File']['type'];$fileatt_name=$_FILES['File']['name'];$headers="From: $from";if(is_uploaded_file($fileatt)){$file=fopen($fileatt,'rb');$data=fread($file,filesize($fileatt));fclose($file);$semi_rand=md5(time());$mime_boundary="==Multipart_Boundary_x{$semi_rand}x";$headers.="\nMIME-Version: 1.0\n"."Content-Type: multipart/mixed;\n"." boundary=\"{$mime_boundary}\"";$message="This is a multi-part message in MIME format.\n\n"."--{$mime_boundary}\n"."Content-Type: text/plain;charset=\"UTF-8\"\n"."Content-Transfer-Encoding: 7bit\n\n".$message."\n\n";$data=chunk_split(base64_encode($data));$message.="--{$mime_boundary}\n"."Content-Type: {$fileatt_type};\n"." name=\"{$fileatt_name}\"\n"."Content-Transfer-Encoding: base64\n\n".$data."\n\n"."--{$mime_boundary}--\n";}

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.