PHP: A definition
PHP is another programming language that can be used to develop websites. However, unlike HTML, which can only display exactly what you tell it to display, PHP can react to circumstances like, for example, the browser your visitor is using, or the user name they entered in a form.
One of the nicest features of PHP is that nobody can see your code. This brings up another difference between PHP and HTML. When a visitor opens a file that contains PHP code, the server executes the PHP code and sends the result to the visitor's browser, which displays the result. In other words, I'm using PHP to produce HTML code. Only the HTML code is sent to your browser, though, so you don't get to see how my page "thinks".
A drawback of using PHP is that you have to have it installed on your server. I don't know of any free hosting solutions that support PHP. However, you can easily pay around $3.00/month to use a web server with PHP availability.
Things you might use it for include...
- Online Games
- Online Stores
- Message Boards
- Database Access
- And much, much more.
However, what I find most useful about PHP is that in the same way CSS consolidates formatting settings, PHP can consolidate the HTML that should be the same on each page. For example, the entire layout of each page on my website is produced in a single PHP file. Each page then asks that file to tell it what the code should look like. All I have to do to create a new page is edit what appears in this center dark blue area, and edit the page title.
Since PHP can also use logical statements (if the page's name is equal to "web design", then make the web design tab blue), I can have each page display some things differently, but I still only have to edit the page layout once to produce that result.
If you're doing your web page editing on your own computer, you'll need to install PHP to get it to work. Just go to php.net to download. Of course, php.net is not just for installing the software. They've also got an excellent documentation set up. As a warning, PHP is nearly infinitely more complicated than HTML. There are thousands of different functions, and you need to know a lot about programming in general. But if you are familiar with C, C++, or Javascript already, PHP should be a breeze. It shares general formatting quite a bit with all of these.
The Basics | Organization | Formatting with CSS Adding PHP | Some Fun Extras
|