Start learning with our library of video tutorials taught by experts. Get started

Dynamic Dreamweaver Websites: Creating and Validating Forms

PHP email


From:

Dynamic Dreamweaver Websites: Creating and Validating Forms

with Candyce Mairs

Video: PHP email

Now I want to show you how to build the actual PHP information that's going to create the email, and I have a file in here, an extra file in the Chapter Seven start course files. So if you do not have those presently, please replace the scuba vac files folder inside of either zamp or mamp in the HT docs folder. Please replace your version of that folder with the chapter seven start version.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
Dynamic Dreamweaver Websites: Creating and Validating Forms
3h 34m Intermediate May 19, 2011

Viewers: in countries Watching now:

Forms perform an essential function in modern websites, making it possible to gather information from users and validate that information. In this course, Adobe Certified Expert Candyce Mairs shows how to create forms to email user information and validate user data using various methods of form validation. These validation methods include client-side, server-side, and custom validation; CAPTCHA images; and Spry validation fields. You'll also see how to set up a PHP testing environment and preview PHP pages in Dreamweaver. Along the way you'll build your skills in areas like using admin consoles, commenting code, working with variables and includes, and much more.

Topics include:
  • Installing XAMPP on a Windows system
  • Installing MAMP on a Mac system
  • Using admin consoles
  • Creating PHP pages
  • Commenting code
  • Working with web forms
  • Adding custom validation
  • Using redirects
  • Dealing with email issues
Subjects:
Developer Web Web Design Web Development video2brain
Software:
Dreamweaver
Author:
Candyce Mairs

PHP email

Now I want to show you how to build the actual PHP information that's going to create the email, and I have a file in here, an extra file in the Chapter Seven start course files. So if you do not have those presently, please replace the scuba vac files folder inside of either zamp or mamp in the HT docs folder. Please replace your version of that folder with the chapter seven start version.

There are a few additional files that have been added within the chapter seven start files, and those are the ones I'm going to be talking about. I'm going to open up a file called testemail.php. And we're just going to look at the code on this page, but here is how you can use this file. I put this in the Course files. This is an accurate working model of sending an email.

The idea is you get this on your server, you enter your email address in two locations. Enter it here and enter it here and all you have to do on your web server is open this file in the browser and you should receive an email with a subject of test and the body of the email should say this is a test email. This file will allow you to test and make sure that the email is working on your web server. The reason I'm doing that is because in a local host environment. In a development environment like we are working in. Testing emails usually does not work.

The web server is what sends an email. It is not PHP that sends the email. So this message you're looking at is simply gathered up by PHP. And forwarded using the mail function. This is forwarded to the male transport agent, or MTA. Within your web server and that portion is what actually sends the email. So PHP doesn't have direct contact with the email portion, it's the web server that actually sends the email.

So this file will give you a chance to test your email make sure you're actually receiving your email, before you take a look at the Contact Us form. Now, there are a lot of things that can occur, in trying to send an email. A lot of issues, things such as spam filters, can prevent an email from being received. And your SMTP server, your web server itself, may have to be configured. So our local environment, we cannot use to test emails, or at least not accurately.

So your development environment, if you open this file in the browser, nothing will happen. If you put this on a live web server thats actually functioning and has an smtp server set up within it this will work perfectly. So actually sending thee email is a difficult process in the development environment and what you're going to want to do is get it onto a live web server in order to accurately test it. So here's a very basic form. All this code is correct.

If this does not email, then there's something wrong on the web server side. But do not try and do this in the local environment. Now, this particular feature, what we're doing is setting up our To, Subject, Body, the headers is going to list who this is from. And this is what actually puts the email message together. So this mail function has four pieces separated by commas and your standard php semicolon at the end. This goes inside of php tags.

So the php email portion It's pretty simple. It's really just this line of code. Every other line of code is building those different pieces within this parentheses area. When we look at our Contact Us final form version, this same mail function will be working. But it will be populated with the form data, so we'll take a look at that in another movie. Just note, this test email can used, make sure you put your email address in line two, where it says to do so, and line three, where it says to do so between the quotes.

The double quotes specifically. If you run this and you get an email, your email system is working correctly so your Contact Us final version from the scuba vacations website, if you put that on your server it should work correctly as well.

There are currently no FAQs about Dynamic Dreamweaver Websites: Creating and Validating Forms.

Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dynamic Dreamweaver Websites: Creating and Validating Forms.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked