Tag Archives: PHP101

PHP 101: PHP For the Absolute Beginner

      48 Comments on PHP 101: PHP For the Absolute Beginner

p. This area is intended for everyone new to PHP. It opens with a series of informal, entertaining tutorials written by Vikram Vaswani, founder and CEO of Melonfire. These tutorials build on a previously-published 5-part series which has now been updated and extended to embrace PHP 5, making parts of it suitable for those of you who already have worked with PHP 4 in the past.

PHP 101 (part 5): Rank and File

      41 Comments on PHP 101 (part 5): Rank and File

p. When you first started reading this series, I promised you that you’d have a whole lot of fun. If you’re the cynical type, you may be feeling that I didn’t keep my promise. After all, how much fun have you really had so far? All you’ve done is learn a bunch of theoretical rules, added and subtracted numbers from each other, learnt primitive decision-making and gone round and round in the circular funhouse of loops. Heck, if this wasn’t a PHP tutorial, it would be kindergarten…I hear you.

PHP 101 (part 7): The Bear Necessities

      25 Comments on PHP 101 (part 7): The Bear Necessities

p. So now you know how to create your own functions in PHP, and you’ve spent the last few days busily inspecting your applications and turning repeated code fragments into functions. But functions are just the tip of the software abstraction iceberg. Lurking underneath is a three-letter acronym that strikes fear into the hearts of most newbie programmers.

p. OOP.

PHP 101 (part 8): Databases and Other Animals – Part 1

p. One of the most compelling things PHP has going for it is its support for a variety of database management systems, including MySQL, PostgreSQL, Oracle and Microsoft Access. By virtue of this support, PHP developers can create sophisticated data-driven Web applications at a fraction of the time and cost required by competing alternatives. And nowhere is this more clear than in PHP’s longtime support of MySQL, the very fast, very reliable and very feature-rich open-source RDBMS.

PHP 101 (part 9): SQLite My Fire! – Part 1

      10 Comments on PHP 101 (part 9): SQLite My Fire! – Part 1

p. If you’ve been paying attention, you now know how to use PHP’s MySQL API to perform queries and process result sets. You might even have started thinking about how to re-program your site to run off a MySQL database. All of this is a Good Thing – it means you’re getting comfortable with using PHP’s database support to power your applications – but there’s still a little further to go.

PHP 101 (part 10): A Session In The Cookie Jar

      16 Comments on PHP 101 (part 10): A Session In The Cookie Jar

p. Now that you’ve used PHP with MySQL and SQLite, you probably think you know everything you need to get started with PHP programming. In fact, you might even be thinking of cutting down your visits to Zend.com altogether, giving up this series for something flashier and cooler…

p. PHP 101 (part 10): A Session In The Cookie JarUh-uh. Big mistake.

PHP 101 (part 11): Sinfully Simple

      13 Comments on PHP 101 (part 11): Sinfully Simple

p. Unless you’ve been hiding in a cave for the last few years, you’ve heard about XML – it’s the toolkit that more and more Web publishers are switching to for content markup. You may even have seen an XML document in action, complete with user-defined tags and markup, and you might have wondered how on earth one converts that tangled mess of code into human-readable content.

p. The answer is, not easily.

PHP 101 (part 12): Bugging Out – Part 1

      3 Comments on PHP 101 (part 12): Bugging Out – Part 1

p. Even the best developers make mistakes sometimes. That’s why most programming languages – including PHP – come with built-in capabilities to catch errors and take remedial action. This action can be as simple as displaying an error message, or as complex as sending the site administrator an email with a complete stack trace.

p. To make it easier to do this, PHP comes with a full-featured error handling API that can be used to trap and resolve errors. In addition to deciding which types of errors a user sees, you can also replace the built-in error handling mechanism with your own custom (and usually more creative) functions. If you’re using PHP 5, you get a bonus: a spanking-new exception model, which lets you wrap your code in Java-like try-catch() blocks for more efficient error handling.

p. In this edition of PHP 101, I’m going to discuss all these things, giving you a crash course in how to add error-handling to your PHP application. Keep reading – this is pretty cool stuff!

PHP 101 (part 13): The Trashman Cometh – Part 1

p. Maybe you’ve heard the term GIGO before.

p. If you haven’t, it stands for Garbage In, Garbage Out, and it’s a basic fact of computer programming: if you feed your program bad input, you’re almost certainly going to get bad output. And no matter which way you cut it, bad output is not a Good Thing for a programmer who wants to get noticed.

PHP 101 (part 14): Going to the Polls – Part 1

      7 Comments on PHP 101 (part 14): Going to the Polls – Part 1

In the course of this series, I’ve taken you on a tour of PHP, teaching you everything you need to know to get started with this extremely powerful toolkit. You’ve learned how to process arrays, write functions, construct objects, and throw exceptions. You’ve also learned how to read user input from forms, search databases, and use cookies and sessions to maintain state. You’re no longer the timid PHP newbie you used to be, but a bold and powerful PHP warrior, ready to take on anything the world (or your boss) throws at you…