Jump to content

fluid | fixed

PHP script help (with attachments)


  • Please log in to reply
2 replies to this topic

#1
Mr.Techie456

Mr.Techie456

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 135 posts
  • Gender:Male
I really need some help I have this emailing system for my website that is PHP based, and some of my e-mailers have been complaining that they can't put attachments in the email (such as images, video, etc.). Unfortunately I haven't added that as an option yet. so can somebody help me incorporate that feature into the script i already have.




This the part of my script that send out the information


<?
/*Type anything but all spam and pornographic content will be blocked*/



	$emailSubject = 'Stefanscorner.com (Email)';

	$webMaster = 'email address here';

	

/*Gathering Data Variables*/



	$nameField = $_POST ['name'];

	$emailField = $_POST ['email'];

	$commentsField = $_POST ['comments'];

	

	$body = <<< EOD





Name: $nameField


Email: $emailField


Comments: $commentsField


EOD;



	$headers = "From: $email\r\n";

	$headers .= "Content-type: text/html\r\n";

	$success = mail($webMaster, $emailSubject, $body, $headers);

	

/* Results rendered as HTML */



  $theResults = <<< EOD


?>




Thanks in advance.

#2
Mr.Techie456

Mr.Techie456

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 135 posts
  • Gender:Male
Come on anytime now. With an answer.

#3
el coniglio

el coniglio

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 100 posts
Well, you just have to handle the <input type="file"> in your php, as described in: http://php.net/manua...post-method.php

I suggest to you dinamically create fields using javascript, so you label them "uploadN", in the php you will handle these as in the link above.

To the mail() call, take a look in this tutorial: http://www.webcheats....php#attachment





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2013 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   Web hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy