Join David Powers for an in-depth discussion in this video What you should know before watching this course, part of PHP for Web Designers.
This is a course for web designers, so it might sound like stating the obvious to say that you need to know HTML. What I mean by that, is that you have no fear of looking at HTML code, and that when you do so, you know what the different elements are for. A solid understanding of HTML is necessary. Because a lot of the PHP code used in this course is embedded directly in the HTML. If you don't know your way around the HTML structure, you're likely to make a lot of frustrating mistakes.
The best way is to instal a local testing environment on your computer. There are several all-in-one packages that instal phpMySQL and phpMyAdmin. On Windows my preference is to use XAMPP. On my Mac I use MAMP. Both are free. If you don't want to install a local testing environment, you can use an existing website as long as it has PHP and MySQL installed. However, it's not as convenient because you need to upload your files every time you make a change.
If you need help with installing a local testing environment, check out installing Apache, PHP, and MySQL with David Gassner on lynda.com. Whichever testing environment you choose, I recommend that it should be configured to display error messages and that error reporting should be set to the highest level. If you're using MAMP on a Mac, the display of errors is turned off by default. Be sure to watch the separate video in this course to show how to turn them on. When it comes to writing PHP code, whichever program you're currently using to write HTML pages should be sufficient.
However, you'll find it easier if your editor has the following features. Code coloring for PHP. Automatic syntax checking that alerts you to mistakes in your code. PHP code hints, and autocompletion. And the ability to find matching opening and closing braces, parentheses, and brackets. In this course, I'll be using Dreamweaver CS6. Which has all of these features. But this course doesn't rely on features exclusive to Dreamweaver. So feel free to use whichever program you feel most comfortable with.
If your editing program doesn't have the features I've recommended. Joseph Lowery's course on choosing a PHP editor has several alternative suggestions. There's just one final thing that you need, patience. Unlike HTML, programming languages like PHP don't tolerate mistakes. As a beginner, you're likely to make quite a few. I'll try to warn you of common errors, and there's a special chapter devoted to dealing with error messages. Don't let errors put you off. PHP isn't difficult, and you'll find the rewards of persevering really pay off in the end.
Note: This course was recorded with Adobe Dreamweaver, but you can use the code editor of your choice to follow along.
- How to use PHP in a webpage
- Storing and displaying text and numbers in variables
- Using functions
- Adding comments to your PHP scripts
- Moving common page elements to include files
- Displaying different content on a page
- Working with multiple values in arrays and loops
- Getting form input sent by the POST method
- Using PHP sessions to preserve data
- Storing data in session variables
- Connecting to and querying a database
- Handling errors