My Killer PHP Learning Tips

September 3rd, 2009

php logo

Hi,

Learning to program can be a frustrating process for a lot of people; especially for designer types wanting to learn a little PHP. The following tips should help a lot of you along the way to becoming a PHP nerd. My PHP learning tips:

1. Be patient:

Patience is a virtue, especially when learning to program. Don’t be discouraged if something doesn’t sink in right away. It will come with time.

2. Learn to write code on faith:

… That means writing PHP code that you may not fully understand. The process of actually writing out the code, seems to help the brain take it in.

3. Learning PHP programming is a lot like learning a sport; you can pick up stuff by sitting on the sidelines and watching, but you don’t really know what you’re doing until you actually get into the game. In PHP, that means actually writing code and not just sitting listening or reading about it.

4. Take a breather:

If something is not sinking in right away, move on to something else and come back to it later … actually, give it 24 hrs to sink in. I find that the brain will work on problems over night and almost magically, things that you could not understand the day before, will become obvious.

5. Try variations in your code:

Play with different ways of doing things, try to add variation to your code. If for instance you are learning something as simple as a conditional statement .. like the ‘if’ statement, try some examples with mathematical equations and then maybe try something using a function that returns a true/false value.

6. Break your code:

One of the best ways to learn any programming language is to purposefully break code. Why? Basically it comes down to seeing what type of error messages you get for certain types of mistakes in your code. In time, you will see that particular errors will give you consistent error messages. Once you know these, debugging code will be a lot easier.

I’ve found that breaking things on purpose and in a controlled manner, can really help down the road when you run into real errors, because you will recognize the error messages.

PHP vs. Perl vs. Java – a student’s question.

August 17th, 2009

Once and a while, I get a question from a student about PHP and programming that I use in a blog post … here we go again:

… you mentioned that you used to use mostly Java but have switched to mostly PHP. Would you recommend learning PHP as a primary method of creating dynamic web pages or is its strength in data base manipulation. I was learning Perl form processing which led me to your site when I was having trouble with mySQL, and I noticed PHP is very similar (at least in the basics) as Perl. Do you have much experience in using Perl to help create web pages and would you recommend using it at all?

About PHP vs. PERL vs. Java:

PHP is the way to go. Perl is a good language but it was not designed initially for web development – that functionality was added later.

Whereas PHP (which borrows from Perl btw) was designed specifically for web development, and so Perl is just clunkier compared to PHP when it comes to creating dynamic web sites.

I’ve used Perl in the past, mostly creating simple string parsing scripts and other little things. But I would NOT call myself an Perl programmer – so take that into consideration.

That said, I’ve always liked a common strategy used in Perl, where they generate static pages from dynamic code. For example, in our web designers directory, I used a Perl based directory script that uses that strategy.

… What’s interesting is that it generates the directory pages as static HTML pages. The advantage of this is that the directory itself is more portable and much less resource intensive because for the most part, the directory is just of pages that people just read … no need for them to be dynamically generated every time a user request it.

Read the rest of this entry »

What makes a professional programmer?

August 11th, 2009

I recently got an email question put to me by someone wanting to know what makes a professional programmer:

Since I have started my career, I have been working for managers who really don’t know how to program. I have been improving myself through tutorials and books. However, I still don’t know whether i’m a good programmer or just better than the guys i’m working with.

Can you tell me what makes a good programmer? Better yet, please tell me what level should a PHP programmer be at after three years of development?

The short answer:

A good programmer is able to put out clean code that works and is easy to update. Simplicity is a sign of professionalism in any profession or discipline.

In the same email, he continues to ask:

Can you give me a list of books or subjects I should know by now (three years of development). Any advice you give would be much appreciated.

Beyond PHP basics (and the core functionality), I would suggest that PHP programmers should work to learn the following:

  1. Object Oriented PHP
  2. Learn about design patterns. Important ones include: MVC, decorators and factories.
  3. Learn an MVC framework like the Zend Framework or PHPCake etc …
  4. Get deeper into PHP; understand how it works under the hood. This will help you later on when trying to decided how to most effectively build applications.

Notes:

Like any other language, PHP sometimes gives you a few ways to do the same thing. It makes sense to learn the advantages and disadvantages of each for the sake of optimized code. For example, PHP provides a few different ways to interface with MySQL … you have the classic libs but you also have new object oriented methods.

When it comes to learning design patterns, it might be easier to learn a PHP framework at the same time. Why? Many of these frameworks often times provide great examples of popular design patterns.

Final comment:

Though the above is ideal, I’ve have seen many PHP programmers who don’t have half the skills I mention above, but were still effective programmers who got the job done.

Stefan Mischook

www.killerphp.com

Server Migration is Easy with PHP

July 13th, 2009

Recently we had to make an emergency move from our old servers (where we had been for 5-6 years) to our own dedicated server because of technical difficulties in the heads of the nerd’s who managed the servers killersites.com had been sitting on.

I will spare you the details of my server migration ordeal for now. What I want to point out, is that PHP (once again) has proven to be a great choice as the server side programming language.

PHP is consistent …

During this move, I had to deal with a bunch of web apps and scripts that included a nice buffet of technologies like:

- Perl
- PHP
- Java

.. Yes, the dreaded evil configuration hell that is J2EE!!

To make a long story short, migrating the PHP apps was a snap – copy over the files, set up the database and were off! On the other hand, I still have to get around to figuring out why the Perl and Java applications don’t want to run on the new server.

:(

PHP continues to rock, saving me time, money and headaches.

Stefan Mischook
www.killerphp.com

Programmers should learn to be language agnostic.

July 13th, 2009

In my last post I wrote about how Ruby’s early problems around 2006-2007:

- incomplete libraries
- difficult web server integration

.. had played a role slowing its adoption. The main thrust of the piece was to point out that despite the explosion of interest, Ruby and Rails had failed to make much of a dent relative to PHP in terms of usage. In fact, PHP is still far and away a much more popular language.

Read the rest of this entry »

What happened to Ruby? And why PHP is KING of the Web.

July 11th, 2009

In 2006 I created killerphp.com because I wanted to make it easy for web designers to learn PHP. I thought PHP was THE predominate web programming language and I felt every web designer should include PHP as one of their core coding skills:

- html
- css
- php
- javascript.

Then Ruby came along … for a short while.

What happened to Ruby and Ruby on Rails?

Once upon a time Ruby was the best thing since sliced bread … it was the language to replace all languages and everything else just sucked! Funny, that seems like ages ago.

Today though, the picture is different; Ruby’s shine has since lost its’ luster and the Rails train has practically fallen off the tracks – now there are other web frameworks in the Ruby world that have replaced Rails.

Addendum: Merb and Rails are merging … Rails hasn’t ‘gone off the tracks’. My bad.

So what the heck happened … what stopped the Ruby train ride?

Read the rest of this entry »

PHP Video: Controllers in MVC

June 25th, 2009

php video

Hi,

In this video, I talk a little about the MVC design pattern with special attention to the middle layer in MVC: the ‘controller’.

A few points:

- MVC is short for Model View Controller
- The Controller is the part that brokers the communication between the View and the Model.
- The Controller is the throw-away part in MVC.

Watch the video for more details.

Read the rest of this entry »

PHP Video: Improve your PHP skills by learning ANOTHER programming language.

June 21st, 2009

php video

In this video, I discuss how learning another programming language will make you a better PHP programmer. This may seem strange at first, but watch the video and you will see that I am not smoking anything …

Check out the video:

Read the rest of this entry »

PHP Video: Why Zend instead of other PHP Frameworks?

June 14th, 2009

php video

Hi,

In response to my a recent podcast where I recommended that PHP programmers learn the Zend Framework, I was asked why I choose Zend, rather than other PHP frameworks.

The video:

Read the rest of this entry »

PHP Video: always MySQL with PHP?

June 3rd, 2009

php video

Hi,

In this HD video (running time: 4:06), I answer a question put to me recently:

Should you always use MySQL as your database when working with PHP?

Yes, this is a beginners question, I know. Nonetheless, it is a legitimate question that I think is worthy of comment. In answering this question though, I briefly talk about the other database options you have with PHP.

The video:

MySQL with PHP

Note: I am using Youtube’s new HD streaming capabilities as an experiment. This is 720p video so you should have a fast connection to watch it, or some patience. If you find the video is stuttering, just press ‘play’, then pause it and then give it a minute or two to download.

Thanks,

Stefan Mischook

PHP Video: the Zend Framework and Web 2.0.

May 26th, 2009

php video
Hi,

I just released a new PHP video podcast where I answer a few questions put to me about php. I answer these questions:

1. Do you need to learn the Zend Framework?
2. Do you need a PHP certificate?
3. How does PHP fit into Web 2.0.

I am using a totally new format for this video and would appreciate your comments, good and bad about it.

Thanks,

Stefan Mischook

www.killerphp.com

I’m back bearing the gift of Javascript.

May 17th, 2009

video tutorial
Hi,

I’ve been away for a little while and I just haven’t had the time to post anything new to the blog. OK, it is probably more of a question of pure laziness on my part I admit. But I’m back and hopefully will have some interesting new PHP stuff for you guys very soon.

In the meantime, I just started releasing a new series of videos on beginners Javascript. Like the PHP basics videos, I am targeting beginners to Javascript in this new series.

There are a few differences about these videos when compared to my PHP videos:

  1. I am using a larger capture size 800×600 – the videos dimensions are bigger.
  2. I am using a new clearer mic. The same mic that Howard Stern uses.
  3. The volume should be much louder.

So if you had trouble hearing or seeing the PHP videos … (for the visually impaired or inebriated) these new Javascript videos should be easier to watch. There are about 10 videos for you to watch at this time.

Hope you guys find them useful.

Stefan Mischook

www.killerphp.com

New Wordpress Themes Video Tutorial

November 26th, 2008

video tutorial

Hi,

I just released a new video course on how to create a Wordpress theme/template from scratch.

About the video:

Video Synopsis – Building a Simple WordPress Theme

In these 12 videos, we will take someone with some beginner HTML and CSS skills through the steps needed to build a WordPress template from scratch. The videos use only a collection of freely downloadable tools that are available on Windows and Mac.

The goal of this set is to focus on the different files used in a functional WordPress template and how they all work together to build a unified design that is extensible and driven as much as possible from the WordPress blogging framework.

Included in this set is the construction of a dynamic top-level navigation, a widget-friendly sidebar, a customized search form and a specially-designed home page.

It is assumed that the viewer understands HTML and a bit of CSS. A basic understanding of PHP is helpful, but not required.

While its best to follow along, the project files are included in this video.

Those who know me, know that I am a big believer that both PHP programmers and web designers, should learn at least one CMS or blog software package. I jumped into the Wordpress camp a while back for a bunch of reasons:

- It’s popular.
- It’s easy to use.
- It’s easy to customize.

… And it is built with PHP.

Regardless, learning to create templates for Wordpress will help you with your PHP skills because you will learn about how PHP can be used to build a templating system.

Thanks for reading,

Stefan Mischook

www.killerphp.com
www.killersites.com

Podcast: Structuring PHP Projects

November 10th, 2008

In the following podcast I go over the key factor when determining how to structure a PHP project.

In a nutshell, it comes down to the size and complexity of the job. For the details, listen to me yap:
php-podcast-project-structure

Thanks,

Stefan Mischook

www.killerphp.com

Free PDF Chapter: PHP5 CMS Framework Development

October 16th, 2008

PHP5 CMS Book
Hi,

The people at Packt Publishing just sent me a free sample chapter (in PDF format) of their latest PHP book (PHP5 CMS Framework Development) for me to pass on to you guys.

I haven’t had a chance to read the book, so I can’t comment on it. If any of you have, please feel free to post a comment.

The PDF:

PHP5 CMS Framework Development – Chapter 6 Access Control.

-

PHP5 CMS Framework Development

This book guides you through the design and implementation decisions necessary to create a working architecture for a PHP5-based content management system. Each of the major areas and decision points are reviewed and discussed. Code examples, which take advantage of PHP5’s object oriented nature, are provided and explained. They serve as a means of illustrating the detailed development issues created by a CMS. In areas where the code is too voluminous to be reproduced in detail, the design principles are explained along with some critical pieces of code. A basic knowledge of PHP is assumed.

Read the rest of this entry »

How to Build a Content Management System

October 5th, 2008

OK, I just tricked you! This article is not going to teach you how to build a content management system with PHP from scratch.

Why not?

… Because building a content management system from scratch is (probably) a really dumb idea!! Now that I come to think about it, building any of the most commonly used software from scratch, is kinda stupid.

Things you should not build from scratch:

  • Content Management Systems
  • Blog Software
  • Forums
  • Directory scripts

The Top 3 Rules in Programming

The real estate business has a famous set of rules – the top three rules in fact:

  1. Location
  2. Location
  3. Location

The idea behind this rule, is to stress how important location is to a piece of property. In software development (programming), we have a similar set of key rules:

  1. Reuse
  2. Reuse
  3. Reuse

Read the rest of this entry »

PHP Shopping Cart Video Tutorial Course – available for download.

September 22nd, 2008

video tutorial

Hi,

After teasing you guys for a week or so, I’ve released the entire video tutorial course on building a PHP based shopping cart.

There is a small charge ($19.99) to download the entire course, but it is more than worth it since you get 140 minutes of top notch nerd training … and we include the source code too.

The course outline:

PART 1: INTRODUCTION
Duration: 4:49

We’ll quickly go through what the end result our project is supposed to look like and some of the tools that will help us get there.

PART 2: TECHNOLOGY OVERVIEW
Duration: 10:42

A better look at the technologies as well as some of the tools we’re going to be used to build our PayPal shopping cart. We’ll also do a bit of refactoring and explain some of the benefits of using an IDE (integrated development environment).

PART 3: BUILDING AN XML CATALOG
Duration: 17:22

Using XML as our data storage format, we’re going to create a catalog of items for our shopping cart.

PART 4: BUILDING THE CATALOG PAGE
Duration: 15:30

We’re going to put some skin on that catalog and start making it look a little more like a page to buy items and a little less like the index of a phone book.

PART 5: FINISHING THE CATALOG TEMPLATE
Duration: 12:54

With our catalog completed, we’re going to tidy up – or refactor – our project and get ready to build the ShoppingCart object.

PART 6: MAKING AN “ADD TO CART” PAGE
Duration: 15:58

We’ll cover how we can use the $_SESSION array in PHP to store our customer’s order as they navigate our website and add items to the shopping cart. We’ll also start building the Shopping Cart class and look at some object-oriented programming concepts.

PART 7: BUILDING THE SHOPPING CART
Duration: 15:54

We will be adding the major functionality of our shopping cart class in this video and getting it ready for calculating subtotals and totals with shipping costs.

PART 8: CALCULATING COST
Duration: 7:37

We’ll be creating templates for our checkout page in order to have a proper line-item for each product with the necessary cost details.

PART 9: SHIPPING COST
Duration: 10:09

Now that we have the individual items lined up in our checkout page, we can add the shipping costs.

PART 10: FINISHING THE CART TEMPLATE
Duration: 8:38

We’re finally done writing our shopping cart class! Now we can put it to work with our newly created checkout page.

PART 11: SENDING DATA TO PAYPAL
Duration: 11:36

PayPal requires a collection of preset hidden form elements on form submission. These elements act as the glue between our shopping cart and their website, and we’re going to flush them out in this video.

PART 12: PAYPAL SANDBOX INTEGRATION
Duration: 12:31

We’re going to go through the steps needed to create a PayPal Sandbox account. This tool lets us complete transactions without having to pass money through PayPal.

PART 13: A QUICK LOOK AT PAYPAL’S IPN
Duration: 5:47

PayPal’s IPN (Instant Payment Notification) is a handy way of knowing when a transaction has been completed succesfully. We’ll quickly go over how we can pick up data collected by PayPal and how it can be used to track orders after they’ve been placed.

-

Should you have any questions or comments, please feel to post them.

PS: I will have more new FREE PHP and Dreamweaver CS4 videos coming out soon.

Thanks,

Stefan Mischook

Dreamweaver CS4 and PHP

September 19th, 2008

Hi,

One of my reasons for creating killerphp.com, was to make learning PHP easier for web designers. I also wanted to bring awareness to the web design community of the importance of PHP.

… I happen to think that PHP is a key technology in the web design stack, to the point that I believe that all web designers should learn at least some PHP.

That said, I thought it made sense to look at web design tools (such as Dreamweaver) to demonstrate how PHP works in that context.

So … I just released a 6 page article on soon to be released Dreamweaver CS4 detailing its’ PHP and database features.

Dreamweaver CS4 Logo

Check it out: Dreamweaver CS4 Introduction to the PHP toolset.

I also plan on creating a bunch of supporting dreamweaver CS4 video tutorials to help fill in the details not covered in this chapter. I hope you find it useful.

Let me know what you think.

Thanks,

Stefan Mischook

www.killersites.com
www.killerphp.com

PHP Shopping Cart Tutorial

September 9th, 2008

video tutorial

Hi,

I just released a new PHP shopping cart video tutorial for beginners. In this series of videos, you learn how to build a PHP based shopping cart that works with Paypal. Some highlights:

  • It’s object oriented – almost!
  • The shopping cart ‘talks’ to Paypal.
  • Learn how to create XML documents and how to process them with PHP.
  • You also learn a few ‘best practices’ when it comes to programming.

I hope you enjoy.

Stefan Mischook

www.killersites.com
www.killerphp.com

Killerphp Videos Now Available for Download

August 18th, 2008

Hi,

I’ve had many request for access to the videos either on a DVD or in a downloadable format for viewing offline. So after many months of brushing it off, I now have the videos for you … at a small cost:

  • $19.99 for the download
  • $29.99 for the DVD

The videos are still all available to watch online, but you now have the option to take them home with you. Better yet, I’ve re-rendered the videos in a high quality Quicktime video format.

About the videos:

All together, the collection consist of 47 video tutorials (a few hours of videos) that weights in at 1.67 gigs! The collection now covers:

  • Basic PHP
  • MySQL and SQL Basics
  • Object Oriented PHP

.. and a few of other things related to PHP.

The Videos:

Thanks,

Stefan Mischook

www.killerphp.com

Top of page  go to top of page