| PHP is a server-side scripting language that's becoming increasingly popular. It combines the capabilities of a CGI scripting language like Perl, with the convenience of being embedded in Web-page HTML code like JavaScript. Most major Web-hosting companies are adding PHP to their list of supported features, so if you haven't tried this powerful scripting language yet, you may want to check it out. Opening Pages with a ".php" Extension To use a page with embedded PHP code, most Web servers require the page to be saved with the extension ".php" (as opposed to ".htm" or ".html"). The problem is that if you save your Web pages in FrontPage with a PHP extension, you can no longer double click on them in FrontPage to open them in the FrontPage editor. (Quick speculation: PHP competes directly with Microsoft's ASP technology, which might explain why FrontPage doesn't recognize the ".php" extension.) Thankfully, you can configure FrontPage to open up PHP files without much work. - In FrontPage 2000, choose "Tools..." from the "Options" menu. Click the "Configure Editors" tab.
- Double-click on "htm".
- In the "Command" field, select the entire line (this is the path to FrontPage on your computer), then hit Ctrl-C on your keyboard to copy the line.
- Click the "Cancel" button to close the window.
- Click the "Add..." button. You'll get the Add Editor Association window.
- For File type, enter "php" (without the quotes, of course). In the Editor name field, enter "FrontPage". Then click in the Command field and hit Ctrl-V on your keyboard; this will paste the location of the FrontPage application into this field.
- Click "OK"—you're done!
Note: You could have clicked the "Browse" button and located FrontPage on your hard disk; however, for me it's quicker and easier to just copy the location from another entry. Embedding PHP Code Most tutorials on PHP specify that you should enclose your PHP code in <?php ?> tags. While this will work in the FrontPage editor, it will wind up displaying your PHP code in the "Normal" and "Preview" windows. What works much better is to enclose your PHP in <script> tags. This way, you'll only see the script icon (like this: ) in your Normal view, and nothing in your Preview view. Here's a quick example: <script language="php"> print "This text is generated with PHP!"; </script> Note from Chris, 12/12/00: More information on PHP is coming soon, so check back to this page soon. If you're a FrontPage user that's also working with PHP, I'd love to hear from you; e-mail me at webmaster@webworkshop.org. <Back to table of contents> |