How to Make a Contact Us PAGE in Dreamweaver

Similar documents
How to lay out a web page with CSS

Adobe Dreamweaver CS5 Tutorial

ADOBE DREAMWEAVER CS4 BASICS

Adobe Dreamweaver CC 17 Tutorial

Using Adobe Contribute 4 A guide for new website authors

Dreamweaver: Web Forms

GoLive will first ask you if your new site will be for one individual or a work group; select for a Single User, and click Next.

Creating your first website Part 4: Formatting your page with CSS

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

How to lay out a web page with CSS

Figure 1 Forms category in the Insert panel. You set up a form by inserting it and configuring options through the Properties panel.

Objective % Select and utilize tools to design and develop websites.

Netscape Composer: Working with Tables

How to set up a local root folder and site structure

COMSC-031 Web Site Development- Part 2

Taking Fireworks Template and Applying it to Dreamweaver

Using Dreamweaver. 4 Creating a Template. Logo. Page Heading. Home About Us Gallery Ordering Contact Us Links. Page content in this area

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Interactive Tourist Map

The Dreamweaver Interface

Using Dreamweaver CS6

Creating Forms. Starting the Page. another way of applying a template to a page.

ORB Education Quality Teaching Resources

Table Basics. The structure of an table

CS Multimedia and Communications. Lab 06: Webpage Tables and Image Links (Website Design part 3 of 3)

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

Dreamweaver Basics Outline

Flash Album Generator 2 Manual Version 1.0. About Flash Album Generator 2. Flash Album Generator 2 Manual version 1.0 DMXzone.com

ADOBE Dreamweaver CS3 Basics

Want to add cool effects like rollovers and pop-up windows?

Layout with Layers and CSS

Dreamweaver CS6. Table of Contents. Setting up a site in Dreamweaver! 2. Templates! 3. Using a Template! 3. Save the template! 4. Views!

NVU Web Authoring System

Dreamweaver Basics Workshop

Section 6: Dreamweaver

Sign in and join ADC Newsletters Feedback. Creating your first website Part 2: Creating the page layout

Getting Started with Universal

Locate it inside of your Class/DreamWeaver folders and open it up.

Using Dreamweaver. 3 Basic Page Editing. Planning. Viewing Different Design Styles

ekaizen Lessons Table of Contents 1. ebook Basics 1 2. Create a new ebook Make Changes to the ebook Populate the ebook 41

Adobe Fireworks CS Essential Techniques

About Freeway. Freeway s Tools and Palettes

Dreamweaver Handout. University of Connecticut Prof. Kent Golden

Building TPS Web Pages with Dreamweaver

Lesson 1 using Dreamweaver CS3. To get started on your web page select the link below and copy (Save Picture As) the images to your image folder.

How to lay out a web page with CSS

Dear Candidate, Thank you, Adobe Education

Dreamweaver Basics. Planning your website Organize site structure Plan site design & navigation Gather your assets

The figure below shows the Dreamweaver Interface.

Dreamweaver CS 5.5. University Information Technology Services. Training, Outreach, Learning Technologies, and Video Production

What is EasyWeb?! 3 EasyWeb QuickStart! 4. Publishing Your Website! 10

HO-FL1: INTRODUCTION TO FLASH

Content: Step-by-Step instructions to duplicate MS Outlook files to a file. Purpose: To move content from one computer to another.

PROFESSIONAL TUTORIAL. Trinity Innovations 2010 All Rights Reserved.

Section 1: How The Internet Works

A Dreamweaver Tutorial. Contents Page

Eng 110, Spring Week 03 Lab02- Dreamwaver Session

Café Soylent Green Chapter 12

Tutorial 4. Activities. Code o Editor: Expression Web o Focus : Base Layout, navigation with folders, external stylesheets, Open up Expression Web

Microsoft Expression Web Quickstart Guide

FrontPage 2000 Tutorial -- Advanced

COMSC-031 Web We S ite Site Development Development- Part 2 Part-Time Instructor: Joenil Mistal April 30, 2013

Authoring World Wide Web Pages with Dreamweaver

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

How to create a prototype

Embedding and linking to media

Architectural Engineering Senior Thesis CPEP Webpage Guidelines and Instructions

Google Earth: Significant Places in Your Life Got Maps? Workshop June 17, 2013

Microsoft Excel 2010 Basic

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

Creating and Publishing Faculty Webpages

ITEC447 Web Projects CHAPTER 9 FORMS 1

Flash MP3 Player DMXzone.com Flash MP3 Player Manual

Figure 1 Properties panel, HTML mode

Implementing a chat button on TECHNICAL PAPER

Dreamweaver Template Tutorial - How to create a website from a template

Introduction to Dreamweaver CS3

Dreamweaver MX The Basics

Website Development (WEB) Lab Exercises

1. Setup a root folder for the website 2. Create a wireframe 3. Add content 4. Create hyperlinks between pages and to external websites

Flash Image Enhancer Manual DMXzone.com Flash Image Enhancer Manual

To illustrate how to set TAG styles the <body> and <h1> tags (for the BODY and the HEADING 1 styles) will be adjusted.

Dreamweaver Domain 4: Adding Content by Using Dreamweaver CS5

Macromedia - Fireworks TechNotes: How to create transparent Pop-up Menus

COMSC-031 Web Site Development- Part 2. Part-Time Instructor: Joenil Mistal

Introduction to Dreamweaver

Dreamweaver 101. Here s the desktop icon for Dreamweaver CS5: Click it open. From the top menu options, choose Site and New Site

Dreamweaver Website 1: Managing a Website with Dreamweaver

Joomla! 2.5.x Training Manual

HAPPY HOLIDAYS PHOTO BORDER

Dreamweaver CS3 Lab 2

Using Microsoft Word. Working With Objects

User Manual. Page-Turning ebook software for Mac and Windows platforms

Outlook Web Access. In the next step, enter your address and password to gain access to your Outlook Web Access account.

Working with Images 1 / 12

Google Earth. Tutorials. Tutorial 2: Annotating Google Earth

1.0 Overview For content management, Joomla divides into some basic components: the Article

Introduction to Cascade Server (web content management system) Logging in to Cascade Server Remember me Messages Dashboard Home

Inserting Flash Media

Goldfish 4. Quick Start Tutorial

Transcription:

We found a great website on the net called http://dreamweaverspot.com and we have basically followed their tutorial for creating Contact Forms. We also checked out a few other tutorials we found by Googling, but the dreamweaverspot one seemed to be the simplest one for beginners. When a Contact Form is made, there are two key parts: a PHP script and a Webpage Form. A PHP script is a set of instructions that needs to be downloaded from the following location: http://www.passyworld.com/pworldcontactus/formtoemail.zip and then extracted. If our web host does not allow scripts to run, then later on we will find that our new contact us page does not work. If this happens we will have to forget about PHP and forms. Instead of using PHP we can easily make and put an image onto the Contact Us page like this one: People can then create their own email to us. (So we can get by without PHP if we need to). The second part of the Contact Form is to create the Contact Us webpage with a Form on it using Dreamweaver. Let s first look at how we modify and set up the PHP script. Setting Up the PHP Script As noted previously, there is a start file of script that we need to download and unzip onto our PC from: http://www.passyworld.com/pworldcontactus/formtoemail.zip Next we need to setup a subfolder in our site using Dreamweaver, called something like PWorldContactUs and into this folder we copy the FormToEmail.php file that we unzipped. How to Create a Contact Us Page in Dreamweaver Page 1 of 17

We now need to modify the PHP file by editing it in Dreamweaver. Change the title to be Contact Form PHP The other step is to change the $my email value line in the PHP from the generic name@yourdomain.com to be the email address where we want the form to be sent to, which for our site is: passyworld@hotmail.com. (Do not use this address in your PHP, use your won one.) If you need to set up a free hotmail account to use for this exercise, then go to the following link for a full set of step by step instructions: http://www.passyworld.com/passypdfs/howtohotmail.pdf The only other thing is to now save this file into our Dreamweaver site folder, and make sure the file type is set to the PHP group, and the filename (which is case sensitive) is exactly FormToEmail. Create Contact Us Webpage We used Adobe Fireworks to make a 1024x768 pixels sized background image for our page: How to Create a Contact Us Page in Dreamweaver Page 2 of 17

Now we need to make some blank starting HTML code. In Dreamweaver do File > New The New Document Dialog Box appears. In the Blank Document list, choose HTML, then click Create to create a new HTML document. In the Title: text field at the top of the Document toolbar, enter Contact Form to add this as the title in your document. Choose File > Save, name it ContactForm.htm then save the document into your local site folder. We now need to setup the background image for our ContactForm.htm HTML code. To do this, we do from the top of page menu: Modify > Page Properties and then click on browse next to Background image, and navigate to where our image is, and then click OK. How to Create a Contact Us Page in Dreamweaver Page 3 of 17

Note that we need to make sure that our HTML and the background image PWContactBkgrnd1024x768.jpg are both in the same folder on our website. This makes our page appear with the Background design on it. We now need to put a Div onto our page, where we can enter some text instructions. First we insert an AP Div box container that we will be able to move around the page to adjust the location of our text. We do Insert > Layout Objects > AP Div and then drag the Div into position. We can then click into the Div box, (to get a big flashing vertical line cursor), and start typing some text into the Div Box. We can set the font, the color and the size of this text using the bottom of screen Properties Inspector: We can also use our mouse to click onto the Div Box and stretch its size and shape, and move it around the page. We can thus make something like this: How to Create a Contact Us Page in Dreamweaver Page 4 of 17

We are now ready to add the Contact Us data entry Form onto the page. We found that we needed to make another AP Div to put the form into. When we did not do this, DW put the form at the top of the page over our background and other items. There was then now way to click and drag the form to any other position. This Div box was dragged out to occupy most of the remaining space on our web page: We next need to click our mouse inside this Div Box, to get a big vertical flashing cursor. Now do Insert > Form then select Form from the Flyout Menu. Now in the Properties Inspector at the bottom of the DW screen: In the Action text box type in FormToEmail.php (this is the file we set up on our site earlier). Change the Method to POST and then in the NAME text box type in ContactForm. This is all shown below on the next page: How to Create a Contact Us Page in Dreamweaver Page 5 of 17

This should add some HTML code to our page as: <form action="formtoemail.php" method="post" name="contactform"></form> Next step is to place the form objects onto the page (the information we would like to collect). We need text boxes for Name and Email Address, and also a Text Area for Comments. To do this click inside our form object (which is defined by a dotted red rectangle in DW: and then from the top menu select Insert > Form > Label. From the Code Window click in between the LABEL Tags and type in Name:. How to Create a Contact Us Page in Dreamweaver Page 6 of 17

Move your cursor in the code window to the end of the >/label> tag, and then from the top menu select Insert > Form > Text Field. Name the Text field name, with a max length of 50 characters in the pop up window that appears: Click the OK button. Test your Form to see how it is going, by Saving and then clicking the planet earth icon (or F12 key) to check how it is working. How to Create a Contact Us Page in Dreamweaver Page 7 of 17

Back in Dreamweaver, click so that the cursor is inside the red from area, and past the white text box, and repeat the above process to make a Label and text box where a person can enter their email address. Name the text field email and give it a maximum length of 80 characters. We then have an interesting problem, because the text entry boxes do not display at max width, and we have tem next to each other, and would like them underneath each other. To get them one under each other, we need to place our cursor in between them here: And then hold down the shift key, and press the Enter key a couple of times: We can make the white text boxes display at maximum width, by clicking on them, and in the Properties inspector at the bottom of DW, set them to have Char Width values of 80 to display them on screen as 80 characters wide. We can also click in the code view onto the label names, and then in the Properties at the bottom of DW, change Font, size, and color, like this: How to Create a Contact Us Page in Dreamweaver Page 8 of 17

Now we need to set up a box where people can type in their comments (which will become the email content). To do this we add another Label and call it Comments. Position our cursor at the end of the email white text box, and then do Insert > Form > Label (just like before). Do the Shift key held down with Enter key at same time, to move down one or two lines inside the red form box, and move the comments box so it is underneath the Comments label. Then add a Text Area multiline box where people can enter their comments. Do to Insert > Form > Text Area in the top menu. For the Input Tag Accessibility Attributes box that pops up, just click on Cancel or on OK to get rid of it. A default text area of 5 rows that are 45 characters wide is inserted. We can alter this in either the code view, or the bottom of screen Properties inspector in DW: Name the Text Area comments from the Properties box at the bottom and give the Character Width a value of 50 and the Number of Lines a value of 10. Also type into the Init Value box : Type comments here and click the submit button when finished. Save the page and use the Planet Earth icon of F12 to test it in the browser and confirm it is working ok. How to Create a Contact Us Page in Dreamweaver Page 9 of 17

We now need to create the submit button. From the top menu Insert > Form > Button and click Cancel on the Input Tag Accessibility Attributes box that pops up. We do not have to name the button, because DW does this for us. Test the finished form and it should look like the one shown below. Fill in the form, and click the submit button in local mode on the PC and see what happens: Note that FormToEmail.php is displayed in the bottom left hand corner of the web screen. Well in Local mode we just get a pop up window that asks us if we would like to Open or Save the FormToEmail.php file. If we click open, it just opens the PHP file in Dreamweaver and does not send an email. Hopefully it will work when we ship all the components to our web host server. However, before we do that we need to add a Rollover Link button to our page so that we can click it to go back to our site s Home page when we are done with the email submit. We can use the Home button images we already have setup for our Homepage, from back How to Create a Contact Us Page in Dreamweaver Page 10 of 17

when we built the Under Construction Page. These images are 94x101 pixels in size, and look like this: They are already stored on our site in the Folder PWorldImages and so we should just be able to point to them. We need to add an AP Div to place the Rollover link into, which we do by the top of page : Insert > Layout Objects > AP Div and then move it into position, and set its Width to 94 and Height to 101 in the bottom of screen Properties Inspector. Now Click inside the Div box, and on the top of screen menu do Insert > Image Objects > Rollover Image and then set the pop up box to have the two images linked to and set the link to be to Index.html like this: Click ok and then test the webpage using F12 to see that the link works ok locally. We also need to modify our Index.HTML homepage so that it now links to this Contact Us page instead of its current link to an under construction page. How to Create a Contact Us Page in Dreamweaver Page 11 of 17

We updated our Index page to point to the ContactForm.htm as the link but had an awful time in Dreamweaver trying to F12 make it work locally. For some reason DW updated the link to look ok in DW, and also looked ok when tested in Internet Explorer, but whenever we clicked it it would just stay on the home page. The Contact Us page would work ok if linked to from some other brand new test HTML we made, and it also ran ok on its own. In the end we gave up, and decided to migrate it all up to the web host anyway. On the actual web host everything links and loads and works fine. and when we click the Submit button, it appears to run the PHP and give us a successful end message (that we know is coded into the PHP script): How to Create a Contact Us Page in Dreamweaver Page 12 of 17

And when we click on the Click here to continue message, it takes us nicely back to the Passy World homepage. However, when we go to check our destination email inbox at passyworld@hotmail.com there are no emails in there. We will have to raise a help request with our Web Hosting Company and see if they can figure out why the script runs ok, but produces no resulting email to our inbox. Maybe our host will output the test emails to us in the next day or so. Anyway, we have seen how to make a form inside a webpage in Dreamweaver, and combine it with a PHP script, just like business sites do in the real world. So it has not been a total waste of time. If we cannot get the page working, we will have to go back to the simple display of an image** of our email address, for people to use their own email program to contact us. We display the email address in an image, rather than as text on our web page to prevent spiders and spammers from capturing our email address by reading our page s source code. How to Create a Contact Us Page in Dreamweaver Page 13 of 17

Getting the PHP Script Working We raised a help request with our web hosting company Namecheap.com (who may I say are always sensational at supplying support answers within 24 hours and highy recommended). The showstopper is because of Spammer problems, our host does not let the From field on an email be the sender's email address. The from field must be something that cannot be replied to, that is on our Host's server such as: noreply@passyworld.com Namecheap.com also kindly supplied us the following sample PHP: -------------------------------------------------------------------- <?php $mail_to_send_to = "postmaster@yourdomain.tld"; $your_feedbackmail = "noreply@yourhosteddomain.tld"; $sendflag = $_REQUEST['sendflag']; if ( $sendflag == "send" ) { $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $your_feedbackmail". "\r\n". "Reply-To: $email". "\r\n" ; $a = mail( $mail_to_send_to, "Feedback Form Results", $message, $headers ); if ($a) { print("message was sent, you can send another one"); } else { print("message wasn't sent, please check that you have changed emails in the bottom"); } }?> <form method="post" action="feedback.php"> <input type="hidden" name='sendflag' value="send"> Your Email: <input name="email" type="text" /><br /> Message:<br /> <textarea name="message" rows="15" cols="40"> </textarea><br /> <input type="submit" /> </form> -------------------------------------------------------------------- How to Create a Contact Us Page in Dreamweaver Page 14 of 17

We had to make some substantial changes to this PHP as follows: We need to set postmaster@yourdomain.tld to be info@passyworld.com (or we can use passyworld@hotmail.com but cannot get all the fields passed) and "noreply@yourhosteddomain.tld" to be noreply@passyworld.com in the PHP script. We also need to change the variable names in the Namecheap PHP to match our form which has: Person's Name = name (we will need to add this variable to the Namecheap script) Person's email address = email (this matches our form HTML ok already) Persons comment text is 50 chars by 10 lines, not 40x15 and = "comments" (not "message") The bottom part of the PHP builds a form on the screen, which we do not need, and so we will delete it. We will replace it with some HTM code form our old PHP that says thankyou, it was sent. We also have to save this PHP with a name of "feedback.php" and set the Action field on our form in Dreamweaver to be "feedback.php". We also needed to remove the If statement, and make a few other changes to end up with this as our final PHP: -------------------------------------------------------------------- <?php $mail_to_send_to = "passyworld@hotmail.com"; $your_feedbackmail = "noreply@passyworld.com"; { $email = $_REQUEST['email'] ; $name = $_REQUEST['name'] ; $message = $_REQUEST['comments'] ; $headers = "From: $your_feedbackmail". "\r\n". "Reply-To: $email". "\r\n". "Name: $name". "\r\n" ; $a = mail( $mail_to_send_to, "PW Contact Us Message", $message, $headers );?> } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>contact Form PHP</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#ffffff" text="#000000"> How to Create a Contact Us Page in Dreamweaver Page 15 of 17

<div> <center> <b>thank you <?php print stripslashes($_request['name']);?></b> <br>your message has been sent <p><a href="../index.html">click here to continue</a></p> </center> </div> </body> </html> -------------------------------------------------------------------- So when we enter a message like this: And receive the PHP confirm message ok: and the click here takes us back to the home page (we set this link up using Dreamweaver) How to Create a Contact Us Page in Dreamweaver Page 16 of 17

The resulting email we get to the hotmail inbox is as follows: The problem with this email is that it does not give us the person s email address or their name which they entered onto our original form. This is the main drawback to using hotmail. If we use the email service provided by our web host, by sending our email to info@passyworld.com instead of to passyworld@hotmail.com then we get an email with headers where we can see the sender s email in the Reply-To: header like this: So the Best advice we can give on making a Contact Us webpage, is to obtain a model PHP script from your web host, and not blindly try to make one yourself. If you are using a great web hosting company like Namecheap.com, then this should be a breeze. How to Create a Contact Us Page in Dreamweaver Page 17 of 17