There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
How can i get a form to e-mail the data?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
evoke's Avatar
Junior Member with 1 posts.
 
Join Date: Oct 2007
28-Oct-2007, 07:58 AM #1
How can i get a form to e-mail the data?
Hi,

I am hoping someone will be able to help. Im creating a form to go on a business website.

I have downloaded a trial of Dreamweaver and have found it very useful for creating the form. The form looks ok, but i am wondering how can i get the data that has been entered to get emailed to a certain address.

I have been searching around online and tried various instructions but i can't get the php part to work. Since its going to be on a business website, i dont want to use the free form to mail ones. The server that it will be on does support PHP. During searching i read that the data can also be stored in MS Access. Is this tricker to do or is it best to just to stick with the one e-mail task?

If anybody can help, it would be very much appreciated.

Below i have pasted in the code for the form, just in case.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

<!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>Untitled Document</title>
<style type="text/css">
<!--
.style7 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; }
.style9 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; }
-->
</style>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<table width="928" border="0">
<tr>
<td width="154"><div align="right"><span class="style9">Name</span></div></td>
<td width="28">&nbsp;</td>
<td width="732"><span class="style7">
<label>
<input name="name" type="text" id="name" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Company</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input name="company" type="text" id="company" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Postcode</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input name="postcode" type="text" id="postcode" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Phone</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input name="telephone" type="text" id="telephone" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Mobile</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input name="mobile" type="text" id="mobile" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Email</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input name="email" type="text" id="email" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Preferred Contact Method</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input type="radio" name="radio" id="Phone" value="Phone" />
</label>
Phone
<label>
<input type="radio" name="radio" id="Mobile" value="Mobile" />
</label>
Mobile
<label>
<input type="radio" name="radio" id="email2" value="email" />
</label>
Email</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Position Needed</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input name="Position" type="text" id="Position" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Hours Per Week</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input name="Hours" type="text" id="Hours" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Hourly Rate (If Known)</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input name="hourlyrate" type="text" id="hourlyrate" size="57" />
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Work Type</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<input type="radio" name="radio" id="fulltime" value="fulltime" />
</label>
Full Time
<label>
<input type="radio" name="radio" id="parttime" value="parttime" />
</label>
Part Time
<label>
<input type="radio" name="radio" id="casual" value="casual" />
</label>
Casual
<label>
<input type="radio" name="radio" id="temp" value="temp" />
</label>
Temporary
<label>
<input type="radio" name="radio" id="other" value="other" />
</label>
Other</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Job Description</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<textarea name="jobdescription" id="jobdescription" cols="45" rows="5"></textarea>
</label>
</span></td>
</tr>
<tr>
<td><div align="right"><span class="style9">Other comments/details</span></div></td>
<td>&nbsp;</td>
<td><span class="style7">
<label>
<textarea name="comments" id="comments" cols="45" rows="5"></textarea>
</label>
</span></td>
</tr>
</table>
</form>
</body>
</html>
[/size]
spacer's Avatar
Computer Specs
Member with 30 posts.
 
Join Date: Sep 2007
Location: CA Desert
Experience: Begintermediate
28-Oct-2007, 03:46 PM #2
In the <form> tag , <form id="form1" name="form1" method="post" action=""> ,
try inserting mailto:xxxxxx@youreddress.com between the quote marks at action="" .
haswalt's Avatar
Computer Specs
Senior Member with 416 posts.
 
Join Date: Nov 2004
Location: South Coast, UK
Experience: Advanced
29-Oct-2007, 08:11 AM #3
If you put mailto: in there, i know i get this message in ie7 when i clidk submit ( there is nop submit button i the code you posted btw):

"This form is being submitted using e-mail.
Submitting this form will reveal your e-mail address to the recipient, and will send the form withouth encrypting it for privacy.

You may continue or cancel this submission"

I would avoid access at all costs, not a good idea specially for web dev.

I would use the php method as it's easier to format and doens't give you mesasges and warning popups

PHP Code:

$boundary 
uniqid("HTMLFORM");
$headers "From: webserver@domain.com\r\nMIME-Version: 1.0\r\nContent-Type: multipart/alternative; boundary = ".$boundary."\r\n\r\n";

$headers .= "--$boundary\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nContent-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("New form information:\r\nName: ".$_POST['name']."\r\n"));

$headers .= "--$boundary\r\nContent-Type: text/html; charset=ISO-8859-1\r\nContent-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("A new form has been submitted. Here is the result: <br /><br /><b>Name:</b> ".$_POST['name']."<br />"));

$sent mail("admin@domain.com""New Form Submission"""$headers);

if(
$sent){
     echo 
"Thank you form successfully submitted";
}else{
     echo 
"Sorry, there was an error submitting the form";

The content of the email is onyla rough guide so you can see how to do the rest of the fields into the email. If you need more help i can give it.

Harry
__________________
LQD Internet Limited
We've just got better! With the launch of our new site we have SLASHED our prices and upped the offering. Check it out!

10% Discount for ALL Tech Support Guy Members
Simply use the promo code of "T3CHGUY" when ordering to recieve your 10% discount on all shared and reseller hosting packages.
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,516 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
29-Oct-2007, 02:03 PM #4
I'm with haswalt on this. Use some kind of server-side script to send the e-mail out for you. I recommend FormMail by Tectite.

Peace...
rickfisher's Avatar
Computer Specs
Member with 34 posts.
 
Join Date: Nov 2007
Experience: Beginner
04-Nov-2007, 05:31 PM #5
PHP Help
As far as I can remember, PHP scripts created in Dreamweaver won't work in trial mode, meaning you have to upload them to the server in order for them to function properly. Dreamweaver should set it up for you so that a .txt file is sent to you with the information that people type in. Works the same ways as a guestbook.
__________________
Your processor's writing checks your hard drive can't cache!
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,208 posts.
 
Join Date: Oct 2006
05-Nov-2007, 08:14 AM #6
Quote:
Originally Posted by tomdkat
I'm with haswalt on this. Use some kind of server-side script to send the e-mail out for you. I recommend FormMail by Tectite.

Peace...
Whew!

Almost 10,000 lines just to send an email!
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,516 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
05-Nov-2007, 04:08 PM #7
Quote:
Originally Posted by MMJ
Whew!

Almost 10,000 lines just to send an email!
Yeah, that is a lot. Gotta keep those damned spammers at bay.

Peace...
Reply


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 On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:03 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.