|
|
|
Background on PHP
PHP stands for PHP: Hypertext Preprocessor. Hypertext
refers to files linked together using hyperlinks, such as HTML (HyperText Markup Language) files.
Preprocessing is executing instructions that modify the output. Below is a demonstration of the
difference between HTML and PHP files.
Accessing an HTML Page
- Your browser sends a request to that web page's server (computer) for the file (HTML or image)
you wish to view.
- The web server (computer) sends the file requested back to your computer.
- Your browser displays the file appropriately.
If you request a PHP file (ends with ".php"), the server handles it differently.
Accessing a PHP Page
- Your browser sends a request to that web page's server for the PHP file
you wish to view.
- The web server calls PHP to interpret and perform the operations called for in the PHP script.
- The web server sends the output of the PHP program back to your computer.
- Your browser displays the output appropriately.
Benefit of PHP
Because the server does processing, the output of PHP files changes when its input changes.
For example, most of the pages on the Horticulture site have only two (2) PHP commands:
- Include the header file that defines the links on the left, the banner, and the quick links at the top.
- Include the footer file that displays the mission statement and Horticulture contact information.
Because including the files is performed everytime the PHP file is accessed, when the header/footer
files change, the new content will be immediately updated. In other words, if you add a new link, every
page that includes the header will immediately display the new link.
The mission of Clemson University's Department of Horticulture
is to promote personal and professional growth through the
discovery, communication, and application of horticultural
experiences, knowledge, and scholarship. Our work fosters
environmental stewardship while improving economic wellbeing,
health, and quality of life for all.
|
|