加载中...
You are here:About>Computing & Technology>Python
About.comPython

Part 1: Laying the Groundwork with HTML, CGI, and PHP

From Al Lukaszewski,
Your Guide to Python.
FREE Newsletter. Sign Up Now!

The Web Front End's Three Parts

The web page frontend will be divided into three parts. We are going to use three frames. We could use CSSP and a bit of Javascript, but let's save the fancy stuff for later. The frames will serve the following purposes:

  1. The feed selection menu (a narrow rectangle in the upper left)
  2. The feed items (a large, verticle rectangle in the lower left)
  3. The main page (where the page will load when the headline is selected)

The three frames of the one page are obviously three HTML documents, but only one of them is real when the page is loaded: the menu. The rest are taken by a blank, filler page. So, we have two pages to construct: index and menu . If this application is to exist on a server on the internet, validation is a must. Let us therefore begin with the DOCTYPE declaration:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
This will tell the server which Document Type Definiton (DTD) file to use. The DTD effectively determines the lense through which the server looks at the HTML or XHTML.
  1. Introduction
  2. The Basic Layout: HTML - CGI or PHP - Python power at back.
  3. The Web Front End's Three Parts
  4. The Three Frames of the Web Interface
  5. Accessibility and the NOFRAMES Element
  6. The Only Real HTML Page 1: The Header of menu.html
  7. The Only Real HTML Page 2: The Menu as a Web Form
  8. PHP Plays Middleman Between Python and the HTML Interface
  9. You are Only as Good as Your Data File
  10. On a Web Server

<< Previous | Next >>

 All Topics | Email Article | Print this Page | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.