Preparation
PHP is a general purpose server-side scripting language, interpreted by the web server, and then generates the HTML web page in your browser. Therefore, you will need to upload these pages to a PHP-enabled Web server. Most hosting companies servers use PHP-enabled servers, as PHP is a free and open source language. Contact your hosting company if you are unsure. Another option for testing your PHP includes is to install a "virtual" server on your computer. XAMPP is an excellent free choice that comes with PHP pre-installed, and is available for a variety of operating systems. A third option would be to use Portable Apps, these are a suite of applications to be installed on a portable USB Flash Drive. This is a free download as well, and includes a version of XAMPP with PHP.
3 Main Differences between a standard HTML document and a PHP document:
- PHP scripts should be saved with a .php file extension.
- PHP code is wrapped in ?php...and... ? (as opposed to html).
- PHP has many capabilites, and its own syntax. Although there are many functions, we will learn to use the include() function during this tutorial.
Take the Quizzes
I strongly recommend that you feel comfortable with XHTML & CSS before pursuing this tutorial. Visit the W3C (The World Wide Web Consortium) quizzes for XHTML & CSS. If you receive an 80% or higher on the quizzes, you are ready to create PHP includes!
Back