Featured Hosting Offers:
Using Dreamweaver and PHP to send form results in an email
The form is a primary way to get web interactivity and structured communication. Dreamweaver has a robust and superior implementation of HTML forms. Forms enable user not only to read information passively from the screen, but also to send information back.
One of the more common questions is how to submit a form to send information in an e-mail. Using PHP, it's really very easy. Here we'll learn about processing forms to send e-mail using PHP.
Getting started with forms in Dreamweaver
I am using Dreamweaver MX 2004 but the options are almost same in the old and latest releases of Dreamweaver. We will be making a simple contact form and will deliver the results in an email using a PHP script.
Step 1: Create a form
We have created a simple form with four form fields as:
Step 2: PHP Script for processing the form results
We will use the PHP to send our form results through an email.
Copy and save this code in a file sendresults.php and set the following parameters the according to your requirements.
Step 3: Pointing your form to the PHP script to process it
Select the form and in form properties you will see the following attributes.
The Name attribute is very clear gives your form a name. We have given our form name as Contact form.
The Action attribute determines what should be done with the form content. Most commonly, action is set to a URL for running a specific web application or for sending email.
Here you will give the URL where you saved your sendresults.php file Example www.yourdomain.com/sendresults.php
The Method attribute tells the browser or the web server how to present the form contents to the application that will process the form. “POST” in the Method window indicates that the information in the form will be passed to the program processing the form as standard input. Give method=POST
Save your form and test it.
Points to remember: