DJ Mike's Tutorials: PHP


< ^ >

Prerequisites

This tutorial assumes that you know basic HTML. Although knowledge of basic HTML is not absolutely required, you will be very limited in what you can do with PHP if you don't know HTML, especially forms. Forms are used to input data into a PHP script. If you don't know forms, all of your data must be built into the script itself and the script can only do one thing. For example, if you make a script that resize an image without a form, it will only resize the image listed in the script. If you want to resize another image, you have to change she script itself. If you make a script to resize images that has a form to enter a URL of an image, all you have to do is enter a different URL. If you need a refresher lesson on forms, check out this page.

PHP requires a great deal more patience. With HTML, all you are doing is effecting how a web page looks and you can usually get an idea of where an error is just by looking at the web page. If you have a forgiving browser like Webtv's, you may not even know that you have an error. Not so with PHP! With PHP, if you have a single missing semicolon or quotation mark, you may just get a cryptic error message instead of a web page.

With PHP, you are writing a program and when you write a program, you have to debug it. Don't expect a script to work the first time and you will be pleasantly surprised if it does. Expect to spend more time debugging a script than actually writing it. Sometimes a lot more time.

To learn PHP you must be self motivated and resourceful. With HTML there are less than 100 tags that you can learn. With PHP, there are more than 100 functions just to manipulate images. If your server has Imagick then you have more than 500 functions to manipulate images and that is not including Flash and Ming. Altogether there are more than 4,800 PHP functions, many, if not most, you will never use.

You'll need to learn the basics here then go beyond this tutorial on your own. Go to PHP.net's Manual to see a list of what you can learn. Figure out what may apply to your needs and test it on your own. Use a search engine to find other resources and examples. I saved many of the sources that I learned from on my Tutorial F-Key Saver. I strongly recomend buying a book. PHP 5 For Dummies is a good book to start with.

Be experimental. Don't just read about PHP, try it! Some things I just didn't understand even though I read it over and over. It wasn't till I actually used it that I began to understand. Don't just copy and paste scripts. Once you begin to understand a function or technique, try writing your own script using it from scratch.




< ^ >



Created by DJ Mike from Santa Barbara

DJ Mike


Dance Away Santa Barbara's Home Page
<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>