About This Book

I l @ ve RuBoard

In this book I have attempted to convey both the fundamentals of programming with PHP and some of the more advanced features you may end up using, without going into overwhelming detail. I have used the following conventions to do so:

The step-by-step instructions will indicate what coding you are to add to your scripts and where. The specific text you should type will be printed in a unique type style to separate it from the main body text. Example:

 <?php print ("Hello, World!"); ?> 

The PHP code will also be written out as its own complete script as I go and will be numbered by line for reference (Script i.1). You should not insert these numbers yourself, as it will render your work inoperable. I recommend using a text editor that automatically displays the line numbers for you, as this will help when debugging your work (see Chapter 15, Debugging ).

Script i.1. Better text editors will automatically put in line numbers for you as you work. You should never put these in yourself!

graphics/insc01.gif

In these blocks I will also highlight in red the particular parts being discussed in the step-by-step instruction section to draw attention to new or relevant material. Likewise, where appropriate, sections of the browser window will be marked (Figure i.6). One last view you will see in this book is that of the HTML source itself (Figure i.7), accessed in Netscape Navigator through the View > Page Source menu or in Internet Explorer through View > Source. The difference is insignificant between these two particular figures, but understand that Figure i.7 displays the text the browser receives and Figure i.6 demonstrates how the browser interprets that text. Using PHP, we will create the text that is sent to the browser.

Figure i.6. This is the view you will see of the browser window. It will not make any difference whether you use Netscape Navigator or Internet Explorer (or something else) on Macintosh, Windows, Linux, or any other operating system for the purposes in this book.

graphics/infig06.gif

Figure i.7. By selecting "Page Source" from the View menu in Netscape or "Source" from the View menu in Internet Explorer, you can see the HTML that the browser received. In this case, it only received the text "Hello, World!"

graphics/infig07.gif

Since the column in this book is narrower than the common text editor screen, sometimes lines of PHP code printed here have to be broken up where they would not otherwise break in your editor. A small gray arrow indicates when this kind of break occurs. For example:

 <HTML><HEAD><TITLE>First PHP Script  </TITLE></HEAD><BODY> 

You should continue to use one line in your scripts, or else you will encounter errors when executing. (The gray arrow is not used in scripts that are numbered.)

While demonstrating new features and techniques, I will do my best to explain the why's and how's of them as I go. Hopefully between reading about and using a function you will clearly comprehend it. Should something remain confusing, though, this book contains a number of references where you can find answers to whatever questions you may have (see Appendix C, PHP Resources).

Because of the nature of how PHP works, please also understand that there are essentially three views of every script: the PHP code itself; the code that gets sent to the browser (mostly HTML); and what the browser displays to the end user . I will show as much of these three views as possible, depending upon space constraints, with priority given to the PHP itself.

I l @ ve RuBoard


PHP for the World Wide Web (Visual QuickStart Guide)
PHP for the World Wide Web (Visual QuickStart Guide)
ISBN: 0201727870
EAN: 2147483647
Year: 2001
Pages: 116
Authors: Larry Ullman

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