Introducing the " Tip of the Day " Program

Introducing the "Tip of the Day" Program

Your first program probably won't win any Web awards, but it will take you beyond what you can do with regular HTML. Figure 1.1 illustrates the "Tip of the day" page, which offers friendly, helpful advice.

Click To expand
Figure 1.1: The tip of the day might look simple, but it is a technological marvel, because it features html, cascading style sheets, and PHP code.

Of course, you could write this kind of page without using a technology like PHP, but the program is a little more sophisticated than it might look on the surface. The tip isn't actually embedded in the Web page at all, but it is stored in a completely separate file. The program integrates this separate file into the HTML page. The page owner can change the tip of the day very easily by editing the text file that contains the tips.

You'll start by reviewing your HTML skills. Soon enough, you're going to be writing programs that write Web pages, so you need to be very secure with your HTML coding. If you usually write all your Web pages with a plain-text editor, you should be fine. If you tend to rely on higher end tools like Microsoft FrontPage or Macromedia Dreamweaver, you should put those tools aside for a while and make sure you can write solid HTML by hand.

Start example

The Tip of the day page illustrates one of the hottest concepts in Web programming today— the content management system. This kind of structure allows programmers to design the general layout of a Web site, but isolates the contents from the page design. The page owners (who might or might not know how to modify a Web page directly) can easily change a text file without risk of exposing the code that holds the site together. As you progress through this book, you'll learn how to develop powerful content management systems, as well as a lot of other cool things.

End example