Creating a Dynamic Site Using Dreamweaver MX


You can create Web sites containing dynamic pages on a Web server by creating a Web root folder on the Web server. You can then connect to this Web root folder with Dreamweaver MX and publish dynamic pages to the Web root folder. For example, the ColdFusion MX server stores all the Web pages in the \CfusionMX\wwwroot folder.

Note

The \CfusionMX\wwwroot Web root folder in the Web server is also known as a virtual directory or alias.

To create a dynamic site using Dreamweaver MX, perform the following steps:

  1. Start Dreamweaver MX.

  2. Choose Site, New Site to open the Site Definition dialog box.

  3. Click the Basic tab in the Site Definition dialog box. In the input box, enter the name for your site, such as dynamic_demo.

  4. In the next screen, specify that you want to use a server-side technology.

  5. In the Choose server technology pop-up box, select ColdFusion to indicate that you'll be creating dynamic pages using CFML. Proceed to the next screen. Here, you can choose the path on the server computer where all the dynamic pages will be stored.

  6. Select the first option, indicating that ColdFusion MX server is installed in the same computer where Dreamweaver MX is installed.

  7. Proceed to the next screen. The URL of the site that you're creating appears, as shown in Figure D.9. Proceed to the next screen, where you're asked to choose an alternate remote server where you can store the Web site files.

    click to expand
    Figure D.9: Choosing the HTTP URL of the dynamic site.

  8. Select No if you don't have an alternate remote server, and then proceed to the next screen.

  9. Click OK to finalize the settings.

Creating a Dynamic Page in a Dynamic Site

You can now add a dynamic CFML page to this site:

  1. Choose File, New to open the New Document dialog box.

  2. Select Dynamic Page from the list box under the Category heading.

  3. Select ColdFusion from the list box under the Dynamic Page heading.

  4. Click the Create button to create the CFML page. This opens the newly created HTML page in the Code view of the Document window in Dreamweaver MX.

  5. Select File, Save to save the ColdFusion page in the dynamic site folder.

After creating a dynamic CFML page, you can add your custom code to it using the Code view of the Document window, as follows:

  1. Open a CFML page in your dynamic site by selecting File, Open.

  2. Click the Select Code View button on the Document toolbar to open the Code view in the Document window.

  3. Replace the code shown in the Code view of the document with the following code:

     <html> <head> <title>Your First Dynamic Page</title> <meta http-equiv="Content-Type" content="text/html;        charset=iso-8859-1"> </head> <body>   <form action="" Method="Get">     Enter your Name <input type=text name="Name1">     <input type=submit value="Send">   </form>   <cfif isdefined("URL.Name1") is FALSE>     Please enter your name in the text box and click the button   <cfelse>     <Cfset welcomestring="Welcome to your first dynamic CFML page">     <cfoutput>       #welcomestring# - #URL.Name1#     </cfoutput>   </cfif> </body> </html> 

  4. Choose File, Save to store the CFML code in the dynamic CFML page.

  5. Choose File, Preview in Browser, iexplore to preview the dynamic CFML page in your Web browser, as shown in Figure D.10.

    click to expand
    Figure D.10: Previewing the dynamic CFML page.




Macromedia ColdFusion MX. Professional Projects
ColdFusion MX Professional Projects
ISBN: 1592000126
EAN: 2147483647
Year: 2002
Pages: 200

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net