Sending Form Data to an E-mail address using PHP.

This is a discussion on Sending Form Data to an E-mail address using PHP. within the Macromedia Dreamweaver forums in Adobe Tools category; Hi, Can you please proof this code, to see if it will be able to send data to an e-mail address please. Thanks <fieldset><form id="form1" name="form1" method="post" action="file:///C|/Users/Austin/Documents/PlatinumProStudies/thanksforcontacting ..php"> <fieldset> <p align="center" class="style15">Use the Text Area Below to Contact Us</p> <p align="center" class="style6"><span id="sprytextfield1"> <label><span id="sprytextfield3">To <input name="platinumprostudies @ msn.com, austinzago@gmail.com " type="text" id="to" value="platinumprostudies @ msn.com" size="30" /> <span class="textfieldRequiredMsg">A value is required.</span></span><br /> </label> <span id="sprytextfield2"> <label>Your Contact E-Mail/Phone Number <input type="text" name="E-Mail" id="E-Mail" /> </label> <span class="textfieldRequiredMsg">A value is required.</span></span> </span></p> <span id="sprytextarea1"> <label> <div align="center"> <textarea name="ContactTextArea" cols="45" rows="5" class="style2" id="ContactTextArea" onclick="MM_setTextOfTextfield('ContactTextArea',' ','')">Get fast responses when ...

Go Back   Application Development Forum > Adobe Tools > Macromedia Dreamweaver

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-07-2008, 12:41 AM
azzgo21
Guest
 
Default Sending Form Data to an E-mail address using PHP.

Hi,
Can you please proof this code, to see if it will be able to send data to an
e-mail address please.

Thanks

<fieldset><form id="form1" name="form1" method="post"
action="file:///C|/Users/Austin/Documents/PlatinumProStudies/thanksforcontacting
..php">
<fieldset>
<p align="center" class="style15">Use the Text Area Below to Contact
Us</p>
<p align="center" class="style6"><span id="sprytextfield1">
<label><span id="sprytextfield3">To
<input name="platinumprostudies@msn.com, austinzago@gmail.com"
type="text" id="to" value="platinumprostudies@msn.com" size="30" />
<span class="textfieldRequiredMsg">A value is
required.</span></span><br />
</label>
<span id="sprytextfield2">
<label>Your Contact E-Mail/Phone Number
<input type="text" name="E-Mail" id="E-Mail" />
</label>
<span class="textfieldRequiredMsg">A value is required.</span></span>
</span></p>
<span id="sprytextarea1">
<label>
<div align="center">
<textarea name="ContactTextArea" cols="45" rows="5" class="style2"
id="ContactTextArea"
onclick="MM_setTextOfTextfield('ContactTextArea',' ','')">Get fast responses
when you contact us with Questions and Comments. Tips for our website are also
welcomed</textarea>
<span id="countsprytextarea1">&nbsp;</span> <span
class="textareaRequiredMsg">A value is required.</span><span
class="textareaMinCharsMsg">Minimum number of characters not met.</span><span
class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></div>
</label>
</span>
<div align="center"></div>
<span id="sprycheckbox1">
<label> </label>
</span>
<div align="center">
<p class="style15">Give our Website a Rating.</p>
<p class="style2"><strong>If you have any suggestions, please notate
them in the text area above.</strong></p>
<span id="sprycheckbox2">
<label>
<input type="checkbox" name="1" id="1" />
1 (Poor)</label>
<br />
<input type="checkbox" name="2" id="2" />
2 (Fair)
<br />
<input type="checkbox" name="3" id="3" />
<label>3 (Good)
<br />
<input type="checkbox" name="4" id="4" />
4 (Great)</label>
<br />
<input type="checkbox" name="5" id="5" />
5 (Excellent)
<label> </label>
<span class="checkboxRequiredMsg">Please make a selection.</span>
<span class="checkboxRequiredMsg">Please make a selection.</span><span
class="checkboxMinSelectionsMsg"><br />
Minimum number of selections not met.</span><span
class="checkboxMaxSelectionsMsg"><br />
Maximum number of selections exceeded.</span></span>
<p>
<label>
<input name="Submit" type="submit" class="style6" id="Submit"
value="Submit" />
</label></p>
<?php
$platinumprostudies@msn.com, austinzago@gmail.com=$_POST
['platinumprostudies@msn.com, austinzago@gmail.com'];
$E-Mail=$_POST ['E-Mail'];
$ContactTextArea=$_POST ['ContactTextArea'];
$1=$_POST ['1'];
$2=$_POST ['2'];
$3=$_POST ['3'];
$4=$_POST ['4'];
$5=$_POST ['5']:

mail($platinumprostudies@msn.com, austinzago@gmail.com, $E-Mail,
$ContactTextArea, $1, $2, $3, $4, $5);
?>
</div>
</fieldset>
<div align="center"></div>
<div align="center"></div>
<div align="center"></div>
</form>
<h1>&nbsp;</h1>
</fieldset>

Reply With Quote
  #2  
Old 09-07-2008, 02:07 AM
Th3Show
Guest
 
Default Re: Sending Form Data to an E-mail address using PHP.

Check it out this should help.

http://JasperThayer.com/forms



Reply With Quote
  #3  
Old 09-07-2008, 12:41 PM
azzgo21
Guest
 
Default Re: Sending Form Data to an E-mail address using PHP.

OK so i fixed all the PHP errors, I think, it still isn't working though.

Do I have to upload the page to the server for the form data to be sent?

Here is the code now according to the reference you gave me

<?php
$to="platinumprostudies@msn.com";
$subject="subject"
$message="Text Field Entry:".$E-Mail;
$message="Text Field Entry:".$ContactTextArea;
$message=\nCheckbox Entry:".$1;
$message=\nCheckbox Entry:".$2;
$message=\nCheckbox Entry:".$3;
$message=\nCheckbox Entry:".$4;
$message=\nCheckbox Entry:".$5;
mail($to, $subject, $message);
?>

Is this correct? $to=e-mail address, $subject=the text field "subject
$message= the text field e-mail and contact text area, and the numbers that
follow the checkbox code, are the names of the checkboxes.

Please point out anything incorrect in the PHP code, I'm almost 100% that the
HTML form code is correct, as you can see PHP is not my language Thanks

Reply With Quote
  #4  
Old 09-07-2008, 01:13 PM
azzgo21
Guest
 
Default Re: Sending Form Data to an E-mail address using PHP.

I visited your website, as was about to contact Jasper Thayer from his website, then I realized that you were Jasper Thayer
Reply With Quote
  #5  
Old 09-07-2008, 06:03 PM
Jasper Thayer
Guest
 
Default Re: Sending Form Data to an E-mail address using PHP.

Your form code is incorrect. There are some areas that are not formatted
properly and some areas that are just written wrong! For instance your
checkbox input form fields do not have a value so when someone checks it and
sends you the form you would not receive any information even if your php code
was correct. You need the action of your form to be sent to
your_php_script.php which should include the php script along with a
confirmation message that the form was sent. The php code you have is not
properly concatenated please look at the code I've provided and retry. You
need to be specific about quotations, periods, etc. the name on your form
fields has to be the same as the $variable in php code. You have areas all
over your form code that do not belong for instance this.

<div align="center"></div>
<span id="sprycheckbox1">
<label> </label>
</span>

and this.

<div align="center"></div>
<div align="center"></div>
<div align="center"></div>

and this


<h1>&nbsp;</h1>


My recommendation is to look at the code I've provided, study it, grasp the
concept. Best of luck to you.

Jasper

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:20 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.