Creating a Dynamic Page

Once you set up an application server and a database server, you’re ready to connect to a database, retrieve information, and display it on a web page.

You already know how to handle the first step: Design an HTML page to display the database information. Dynamic pages differ from regular HTML pages in a couple ways. For starters, the name of a dynamic file doesn’t end with .html. Depending on which server model you use, dynamic pages end in .php (for PHP pages), .asp (ASP),.aspx (.NET), or .cfm or cfml (ColdFusion). The file extension you use is important: A web server uses it to identify the type of page requested. If a server gets a request for an .html file, it simply finds it and sends it to the web browser. But if it gets a request for a page that ends in, say, .php, it sends the page to the application server to sort out all the messy programming.

The good news is that the basic process of creating a new, blank, dynamic page is the same as creating a regular HTML page:

  • Choose File→New to open the New Document window. Select the Blank Page category; from the Page Type list, choose a dynamic page type (PHP, for example). From the Layout list, choose a layout (or none if you wish to start with a fresh, blank page), and then click the Create button.

    When you save the file, Dreamweaver automatically adds the proper extension: .asp for ASP pages, .cfm for ColdFusion, or .php for PHP pages.

    Note

    When you create a new page from the New Document window, Dreamweaver ...

Get Dreamweaver CS6: The Missing Manual now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.