This introduction to PHP is not exhaustive by any means. I am aiming to cover PHP as a very broad subject so certain aspects are bound to be omitted. Please keep an eye out for future PC101.com PHP tutorials.
PHP is one of the most popular scripting languages in modern society. The acronym PHP actually means PHP: Hypertext PreProcessor, however there is a rumor that circulates stating that it originally meant Personal Home Page. PHP is free to everyone, which means you can use it to make a commercial website, without paying any licence fee. In addition the community surrounding the development of PHP is huge. This means that any bugs or security issues are quickly identified and fixed, and ensures the continued development of PHP for many years to come.
PHP is a server side scripting language. All this really means is that when you create a PHP script, the script is interpreted by the server and then the results are sent to the users’ browser. HTML however is interpreted by the users browser directly, and thus does not offer the same level of functionality or security as PHP. The most important resulting factor the script being interpreted is that the user can not see your original script, only the elements you choose to output.
An example of server side scripting is the page you are looking at right now! You are seeing a normal website, and if you check the source code of the page you will see no PHP at all. Behind the scenes this page is made up of several pages, and a few thousand lines of code. All this comes together to ensure that when you clicked on this tutorial the content you wanted is delivered to your web browser.
HTML and PHP go hand in hand. PHP is able to provide dynamic web content, and display the content on a web page. All the formatting and layout of the resulting page is coded using standard HTML/CSS. Anyone looking to start using PHP should ensure that they have very strong HTML skills before they embark on their PHP career. In addition strong CSS skills are a major asset. PHP is fairly simple to learn to a useable standard but there are more advanced elements that may take a lot of studying and practice.
PHP is a fantastic tool for working with and modifying databases. It is the preferred option for many projects from a personal website to multi national e-commerce websites. As mentioned above one of the key strengths of PHP is the ability to provide dynamic content. This means you can store information is a database, or even a text file, and then retrieve it as an when it is needed. The simplest example of dynamic content is a search engine. The script retrieves results from a database based on what each individual user types in.
So that’s a very basic overview of PHP. If you want to get started with PHP check the glossary at the bottom of this article, and remember if you are going to pay for hosting remember to check it has PHP included.
In summary PHP;
Is free
Is not difficult to learn
Has a large and helpful community
Scales well from very small websites to very large websites
Provides dynamic content
Integrates with HTML and CSS
Is excellent for working with databases
Provides a good level of content security
Glossary:
Official PHP website
www.php.net
PHP Security:
http://phpsec.org/
A free web server with PHP and mySql to use on your home PC
http://www.apachefriends.org/en/xampp.html