I l @ ve RuBoard |
In order to create your first PHP page, you will start off exactly as you would if you were creating an HTML document from scratch. There are two main differences between a standard HTML document and a PHP document. First, PHP scripts should be saved with the .php extension (e.g., index.php ). Second, you wrap your PHP code with the <?PHP and ?> tags to indicate what is PHP as opposed to what is HTML. To create a new PHP script on your computer:
Tip Check with your ISP to learn which file extensions you can use for PHP documents. For this book you will use .php, although you may be able to use . phtml instead. Servers still running PHP version 3 commonly use .php3 as the default extension. A file extension tells the server how to treat the file: file.php will go through the PHP module, file.asp is processed as ASP, and file.html is a static HTML document. Tip You can also check with your ISP to se if short tags (using <? and ?> instead of <?PHP and ?> ) or ASP tags ( <% and %> ) are acceptable. Programs like Macromedia Dreamweaver can work better with PHP pages if you use ASP tags. |
I l @ ve RuBoard |