tags: apache   archive   business   charity   climbing   comic   communication   database   email   exchange   family   fm2008   hack   hardware   humour   linux   liverpool   microsoft   money   mysql   network   oes   opensource   outlook   php   pictures   process   project   quote   real_life   review   rss   science   security   software   thought   tsm   updates   webdev   website   windows  

Basics of PHP - Part 1

Wed, 22 Aug 2007 07:40:46

Over the next few days I would like to introduce you to the basic principles of PHP. As always it will take you no longer than 60 seconds to scan over the information and pick up some ideas. (Click view page to read more)

PHP is server side web code. This means the code is executed on the webserver before the webpage is sent to your PC. Lets take a look at a simple example.

<?php echo "hello world" ; ?>

<?php - tell the server the following text will be PHP code
echo - a PHP function to echo out information
"hello world" - the text you want to echo
; - tell PHP you've finished with that particular part of code
?> - close PHP tag

If you were to have the above code on your webpage, it would print 'hello world'. A good way to test if PHP is enabled on your server is to create a page with the following code:

<?php phpinfo() ; ?>

If PHP was installed correctly the webpage would show you all the information relating to your PHP installation. When you think about PHP, think about Apache HTTP, that is the common web server for hosting PHP websites.

Cheers
Ryan Partington