Jump to content

Add / Upload Attachment


downah

Recommended Posts

I have got this running, which takes 2 fields subject and plain and will email it to the emails in the database, how can I make it so I have another field which he can upload for example .pdf files and send them with the email?

 

<?php
include "connect.php";
$subject = stripslashes($_POST["subject"]);
$plain = stripslashes($_POST["plain"]);

$result = mysql_query("SELECT email FROM member");
$emails = array();
while ($row = mysql_fetch_row($result))
    $emails[] = $row[0];
$subject = $_POST['subject'];
$from = "[email protected]";
$headers = "From:" . $from;
$to = implode(", ", $emails);

mail($to, $_POST['subject'], $_POST["plain"], $headers);
?>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>
<form id='register' action='updateprofile.php' method='post' accept-charset='UTF-8'>
<body id="main_body" >

<img id="top" src="top.png" alt="">
<div id="form_container">

<h1>Newsletter Sent</h1>
	<form id="form_362567" class="appnitro"  method="post" action="">
				<div class="form_description">
		<h2> Newsletter Sent</h2>
		<p></p>
	</div>						
		<ul >

				<li class="section_break">

		<p></p>
	</li>		<li id="li_2" >
	<label class="description" for="email">
	<?php
echo "Newsletter successfully sent, you will be redirected back to the member area in 5 seconds.";
?>
</form>
		<div id="footer">
<meta http-equiv="refresh" content="5; URL=index.php">
	</div>
</div>
<img id="bottom" src="bottom.png" alt="">
</body>

Link to comment
https://forums.phpfreaks.com/topic/258384-add-upload-attachment/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.