Web Design Forums

PHP

Have questions about PHP? Ask them here and our experts will assist you before you know it! You can also find help in the documentation at PHP.net.

Need some Help with Email Form



Site of the Month Nominations
ENTER YOUR SITE NOW!

Reply
 
LinkBack Thread Tools
Old June 26 '09, 09:10 PM (#1)
RSsimon is offline
New Member!
 
RSsimon's Avatar
 
Join Date: June 2009
Posts: 4
RSsimon is an unknown quantity at this point
Need some Help with Email Form

Hello everyone, i hope my spelling isnt to bad to understand.

Ok lets start, Ive made a basic form in dreamweaver CS3, Then i had a go at codeing a php script that when someone enters the infomation posted on the form it goes into my domain/sever Email account, the info they have entered shows, all correct ect..

now i want them to beable to send me files, Images. but my coding wont work..
what ive done here is added the image tags there, for the php script. and also on my forms in dreamweaver HTML file format i added the File Field and called the tag image1 - then image2 - then image3... but when it comes into my email it does this. Item image1: /tmp/phpPRkkIb
Item image2: /tmp/phpPRkkIb
Item image3: /tmp/phpPRkkIb

ive hiden my email.. so that would change...

HELP ive been trying for hours n hours


PHP Code:
<?php

/* Subject and Email Variables */

    
$emailSubject 'contacts';
    
$webMaster 'Hidenemail@Email';
   
/* Gathering Data Variables */

    
$itemnameField $_POST['itemname'] ;
    
$disField $_POST['dis'] ;    
    
$priceField $_POST['price'] ;  
    
$postField $_POST['post'] ; 
    
$locationField $_POST['location'] ; 
    
$emailField $_POST['email'] ; 
    
$phoneField $_POST['phone'] ; 
    
$image1Field $_POST['image1'] ; 
    
$image2Field $_POST['image2'] ; 
    
$image3Field $_POST['image3'] ; 
    
$agreeField $_POST['agree'] ;  
    
    
$body = <<<EOD
<br><hr><br>
Item name: $itemname <br>
Item Dis: $dis <br>
Item Price: $price <br>
Item post price: $post <b>
Item location: $location <b>
Item email: $email <b>
Item number: $phone <b>
Item image1: $image1 <b>
Item image2: $image2 <b>
Item imagr3: $image3 <b>
Item location: $location <b>
Yes i agree: $agree <b>


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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thanks </title>
<style type="text/css">
<!--
.style2 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #666666;
}
.style3 {
    color: #990000
}
.style4 {color: #333333}
-->
</style>
</head>

<body>
<div>
  <div align="left" class="style2">
    <h2 class="style3">THANK YOU FOR <span class="style4">CONTACTING US</span></h2>
  </div>
</div>
<p>&nbsp;</p>
<div>
  <div align="left" class="style2">Thank you for your interest! Your email will be answered very soon!</div>
</div>
<br />
<br />
<div>
  <div align="left" class="style2"><a href="home.html" class="style3">Return back &gt;&gt;</a></div>
</div>
<p>&nbsp;</p>
</body>
</html>

EOD;
echo 
"$theResults" ;


?>

Last edited by Wired; June 27 '09 at 12:16 AM. Reason: fixed bbcode
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 27 '09, 10:00 AM (#2)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,401
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
First off, your forum needs to have the part in red, so it can send binary files ...

<form action='myscript.php' method='post' enctype='multipart/form-data'>

Then, you need to so some PHP scripting to save the file(s) in a temporary
directory, attach them to the email, and then delete them from the temporary directory.

This is more than we can describe here, so look at some of these:
http://www.google.com/search?hl=en&q...+attach&aqi=g1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 27 '09, 02:32 PM (#3)
imagn is offline
WDF Regular
 
imagn's Avatar
 
Join Date: July 2007
Location: Los Angeles
Posts: 156
imagn will become famous soon enough
This is a great class to both send HTML email (and a plain-text equivalent) and attach files.

http://www.phpguru.org/static/htmlMimeMail5
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » PHP

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple form submit to email Johnny G 69 General Web Design Discussion 3 November 29 '08 10:25 PM
PHP Contact Form Email Verification Abstract PHP 4 October 27 '08 09:57 PM
HELP WITH .PHP EMAIL FORM l_elliott1 PHP 4 September 30 '08 09:07 AM
Email Form homeboy Javascript, AJAX, and JSON 1 July 5 '05 05:37 PM

 
User Infomation
Your Avatar

Site Of The Month

Ticket Cake
Ticket Cake

Ticket Cake is a drupal based event ticketing platform. It features that ability to browse events and share them.

Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 02:39 AM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163