Building the action page
Video: Building the action pageWe have now reached the final version of our form. The moment you've all been waiting for. Let's open up, contact us dash final. This is the final version of our form. This particular version of the form is not using a recaptcha image. I showed you how to do that earlier in this course, but our final version we've decided not to use a recaptcha. This final version does have Java script attached to the form for client side validation using Dream Weaver beavhiors. This form does have server side validation.
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.
- 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
Building the action page
We have now reached the final version of our form. The moment you've all been waiting for. Let's open up, contact us dash final. This is the final version of our form. This particular version of the form is not using a recaptcha image. I showed you how to do that earlier in this course, but our final version we've decided not to use a recaptcha. This final version does have Java script attached to the form for client side validation using Dream Weaver beavhiors. This form does have server side validation.
It's the same server side validation that was looked at in the server side validation piece for the contact us form. So the server side validation is identical to what's in this file. Server validate does not add the email piece. So this final version, does add the email piece. Now, this will not work, if you preview it in the browser, it will not send an email.
In your local host environment, we do not have the entire email setup, within Apache, the SMTP portion configured. And even if we did, in a local host environment, most of the time you cannot get an email to work correctly. So in order to actually have this form send an email, what you want to do is put this Contact us final onto a live web server.
That does have SMTP configured within it. But let's take a look at this form. Now up at the top of this page, I do have a note. This page is live. It's out on my website, so you can go out to this hyperlink and preview this page on a live server. You will not be the one to get the email however, I put an identical version of this page on my website so you can see how it works.
But I will be the one to get the email once it's out of my site at this link, if you are using this version. Feel free to take this contact us final. You will need some additional files in order to preview it correctly, including the images on your website. But this particular version is identical to the one on my site. So, up at the top, this is our server side validation being built. This is the exact same Server Side Validation, as in Server Validate, the piece that is different, begins on line 58.
Within this section, we have an email message being built. And let me close up my Insert bar, up at the top, so I have a little more room here. So if this a valid form, if it passes our server side validation piece, this is where the email will be sent. So in your version you'd want to put your email address here. I told you I have an identical form on my website, so I needed to put in email addresses.
Here's the subject of the form. So when that email comes into me, that will be in the subject line. The dollar message part is actually building the email message portion. So you can see it has a subject. The form name is plugged in. This is coming from a hidden form field, in the form, ad then we have what the user plugged in, so we have their name, email, topic, present customer, tour date, and if they filled in the comments area we will get the comments inlcuded in our email.
The headers portion is listing who this is from. It's also CCing another email address. I wanted to show you how to add this piece in case you need to do it. And line 92 is actually sending the email to the web servers. SMTP server if it is set up. PHP does not actually send the email that web server does. So PHP gathers all this information up and forwards it to the mail transport agent for the web server. Once the user has filled out the form they will be redirected to this particular page, you can see within the scope of that folder on my website, we have the thank you page.
Since you can go out to my website to fill out this form, I wanted to make sure you were redirected when you did to a nice looking thank you page, and then the entire process is exited. So that is what sends our email. Here is our client-side validation. This is built by Dreamweaver behaviors. I'm not using the custom client-side. Here is our actual form. And if I put it InDesign view. It's the exact same form, we looked at in the server side validation piece. If I preview this in the browser, you will see, there's our form. If I click summit, the server side validation will work just fine within your local enviroment.
It's just the actual email Well not get sent out by the web server in this local environment, so if I plug in my name, click submit, name is gone, you can see it turns black once again, and email. If I plug in a good email address and click Submit, we are all set. Add a topic that one disappears. So you can see as we fill these out correctly. Now what if I supply an email address such as this you can see it is not a valid email address. So, you'll have a completely functional form in this version. called Contact us-final, this file is only located within the chapter seven Start files, within your Course files.
Chapter seven is a more complete folder of files, so if for some reason you do not have this one, you want to replace your files with the chapter seven start files. And then retest this page. So that is our final form, complete with client side validation, server side validation and an email script that will sent the email to whoever you specify to send it too. Isn't it amazing how much work it is to put together a single form for a website.
Most people in my classes are amazed at how much work it is. And once you understand that, you tend to be a little less critical of forms out on the web. But they are a part of every website. It's the easiest way to gather data from the user and when you use a form, the web server is spending the information so the user can fill out that form, whether they are on their own machine or whether they are traveling and using somebody else's machine.
So that is a web form, and how to send a webform and it's data in an email out to get our information from a user.
There are currently no FAQs about Dynamic Dreamweaver Websites: Creating and Validating Forms.