What is PHP?
Explained at a very basic level, PHP is a programming language you can use to create 'automated' web pages. Using PHP you can write everything from simple page counters to automated sites like AmIHotOrNot or the gameplay forums.
PHP scripts (programs) are executed by the web server itself when your web browser requests a page. They generate static HTML which is sent to your browser - as a result the web browser never sees any PHP code (it is dealt with by the server) and thus PHP scripts work fine with ANY browser, provided the HTML the script generates can be viewed by that browser.
Still confused? Check out the beginner's tutorial on the official PHP website:
http://www.php.net/tut.php
If you want to build a website using PHP it is essential that your web site host supports PHP - free hosts that offer PHP include F2S and UK Linux.
http://www.f2s.com/
http://www.uklinux.net/
note: f2s.com will be discontinuing free hosting in February 2002.
try http://www.port5.com
[added by the freakysid with apologies to Skunk]
What about mySQL?
PHP and mySQL are often mentioned in the same sentence, however they are completely different things. mySQL is a database system (like Microsoft Access but without the complicated windows interface or the hefty price tag). The PHP language has built in functions for "talking" to mySQL databases, and since mySQL (like PHP) is completely free they are a very popular combination. Using a mySQL database makes it very easy to create sites that store large amounts of information - such as the gameplay forums or an automated articles system.
Getting Started
Before you start learning PHP you need to have somewhere to run it. A free account at F2S or UK Linux will suffice, but an even better option is to install your own PHP web server on your windows PC and run your scripts from there. You need the windows versions of Apache (a web server), PHP, mySQL and a script called phpMyAdmin which will help you easily create and administrate databases in mySQL. That lot may sound daunting but there is a .zip file available for download containing all 4 - simply unzip it onto your hard drive and away you go.
http://www.firepages.com.au/dev4.htm
If you really want to install PHP and Apache yourself (which can be good experience) there is an excellent tutorial here:
http://www.thickbook.com/extra/php_apachephp4_win.phtml
You can get the bits and pieces from...
http://www.apache.org/
http://www.php.net/
http://www.mysql.com/
http://www.phpwizards.net/ -- phpMyAdmin
Learning PHP
PHP is - in my opinion at least - an extremely easy language. If you have had any previous programming experience (up to that point that you understand what variables, arrays, if...then statements and loops are) you shouldn't have any problems at all picking up basic PHP syntax. Even if you don't have previous programming experience starting PHP is a great way to get some.
My personal favourite PHP tutorial anywhere is this one from SitePoint:
http://www.webmasterbase.com/article.php/228/
It starts with the very basics (installing PHP, what it does) and goes on to cover everything from basic programming principles to advanced usage of PHP and mySQL to create a fully databased site. I recommend printing the article out, but be warned it comes to around 111 pages...
Also worth looking at are the PHP 101 tutorials on DevShed:
http://www.devshed.com/Server_Side/PHP/PHP101_1/
http://www.devshed.com/Server_Side/PHP/PHP101_2/
http://www.devshed.com/Server_Side/PHP/PHP101_3/
http://www.devshed.com/Server_Side/PHP/PHP101_4/
http://www.devshed.com/Server_Side/PHP/PHP101_5/
PHP Books
Online tutorials are great but they can only go so far - in practise the quickest and easiest way to learn something like PHP (if you're prepared to shell out the money) is with a good book. Here are my personal recommendations:
PHP Essentials. This is the book I learned PHP from - it expects no previous experience and takes you through from the bare basics to creating a fully database driven e-commerce site (complete with information on how to encrypt credit card details). The only down side is that much of the stuff in this book is covered in the WebMasterBase tutorial mentioned earlier - however at £24.93 (which is pretty cheap for a computer book) this is definitely worth considering:
http://www.amazon.co.uk/exec/obidos/ASIN/076152729X/
Professional PHP Programming. This is a BIG red PHP Bible from wrox publishing. Think of it as the ultimate PHP reference book - between this and the PHP manual there's very little you won't be able to figure out. This book isn't ideal for beginners, but is virtually essential once you've got past newbie level.
http://www.amazon.co.uk/exec/obidos/ASIN/1861002963/
Other books worth investigating (i.e I haven't read them but they've been recommended by other people) include:
PHP: Fast and Easy Web Development
http://www.amazon.co.uk/exec/obidos/ASIN/076153055X/
Beginning PHP4 Programming
http://www.amazon.co.uk/exec/obidos/ASIN/1861003730/
PHP Developer's Cookbook
http://www.amazon.co.uk/exec/obidos/ASIN/0672319241/
The PHP Manual
PHP is blessed with one of the best written, most comprehensive online manuals I've ever seen. The manual is available in several different formats, including a .zip file for download to your local machine. The most useful version is the fully searchable online manual at php.net - complete with user comments. All comments are "moderated" before they go on display on the site so the quality of information is extremely high - in fact I've often found the solution to a problem with a PHP function by browsing through the comments on that function's page in the manual.
http://www.php.net/manual/en/
Useful Tip: You can quickly look up ANY function in the manual by going to
http://www.php.net/the_function_name - i.e
http://www.php.net/date will show you the page in the manual covering the date() function. I use this all the time.
Advanced Tips
Once you've read through a tutorial or read a book the chances are you'll be thirsty for more. The following are useful PHP resources I've found since I started playing with PHP:
PHP Builder - this is the definitive PHP community site. You can learn a huge amount by just reading through the article archive on this site, and fresh content is posted several times a week.
http://www.phpbuilder.com/
Zend - the official site of the "Zend" engine, which is the lightning fast code interpreter used in PHP 4. The site also includes a wealth of PHP articles, tutorials and code snippets (my personal favourites are listed below).
http://www.zend.com/
Introduction to Classes
http://www.zend.com/zend/tut/class-intro.php
Session Handling with PHP 4
http://www.zend.com/zend/tut/session.php
The PHP Base Library (phpLib). This is a library of functions that handle many essential but complicated routines used by the majority of database driven websites. Of particular interest are the user permissions / session management classes and the excellent template class - there is also support for a shopping cart system and a very useful database interaction class.
http://phplib.netuse.de/
Be warned, phpLib is not for the faint hearted (the documentation on the site isn't very friendly). Luckily there are some excellent articles around on how to use the library:
http://www.phpbuilder.com/columns/david20000512.php3
http://www.users.f2s.com/faq/phplib_db.php3
http://www.phpbuilder.com/columns/chad19990414.php3
http://www.devshed.com/Server_Side/P...Lib/print.html
Other sites:
Good list of PHP Tutorials
http://www.find.com.au/tutorials/web....asp?ob=3&pg=0
Installing and using phpMyAdmin
http://www.opendeveloper.org/PHP/How...ment_with_PHP/
Migrating from PERL to PHP
http://www.dotcomma.org/programming/view.php?id=36
DevShed's PHP Section
http://www.devshed.com/Server_Side/PHP/
http://www.phpdeveloper.org/
http://www.phphelp.org/
Finally... places to get pre-written PHP Scripts
HotScripts
http://www.hotscripts.com/
PHP Resource Index (my personal favourite)
http://php.resourceindex.com/
PHP Wizards - home of phpMyAdmin among others
http://www.phpwizards.net/
Bookmarks