PHP
September 15, 2006
Like any good nerd, we’ve been experimenting with a little Ruby and Rails development – it is always good to try new things …
One thing we have noticed is that simple Ruby web apps (running on the same server,) are noticeably slower than PHP.
We installed fastcgi with apache 1.3 (took an hour to do) and are running simple web applications.
I will get into more detail in other post / articles.
read more
September 10, 2006
Another great book from O’Reilly.
This book targets beginners to PHP but NOT total beginners to code and programming – I think that certain explanations of the basic programming concepts, may confuse a some people.
Doesn’t matter though, once you’ve done my free video tutorials (found on this site,) you will be able to breeze through this book.
Besides the basics of PHP programming, the book does a good job teaching basic database theory and concepts – but not so much to bore you to death.
Instead (like the rest of the book,) the coverage of database theory is just enough to get you going with MySQL.
read more
September 1, 2006
I have a nasty habit that is born out of my petty and self destructive instinct for revenge: I spam spammers.
I’ve (like many of you,) have been and still am subject to constant spam attack. But not just one ‘style’, I actually get spammed on all fronts:
- Email spam.
- Blog spam.
- Forum spam.
… it seems that the spam world considers me to be a ‘spam-licious’ target.
REVENGE IS A DISH BEST SERVED WITH PHP
Being an ubernerd … I got me some options to reflect the pain back to my assailants: php mail() and a for loop!
Check it out:
$str = “Automated response From: Killersites.com – you (spammer@some_domain.com) have sent us spam messages … not nice.”;
for($i=0; $i < 250; $i++)
{
$did_send_mail = mail('spammer@some_domain.com','Automated Response From: Killersites.com System', $str);
}
-
Nothing special in the php code here. But it holds a special place in my heart.
Now whenever I see it as required, I fire off this script to the lil' bastard that spammed me. Their lucky I don't slap another zero or two in the loop count:
250 -> 2500 or even 25000!
DOES IT WORK
Well I tend to get much fewer repeat offenders since I’ve been doing this.
read more
August 26, 2006

A quick podcast where I explain the basics behind what database driven websites are.
This podcast targets total beginners.
Database Driven Websites Explained.
read more
August 24, 2006
It has been a couple of years since I moved (from in-house hosting) my Java based web applications to using an outside company.
When I was hosting my little apps from my Windows 2000 server (using Caucho Resin,) on a DSL connection, I never had a problem … probably because it was so small.
Since growing and moving to Tomcat on Linux, I’ve found that Java is not the most stable thing … it is not uncommon for Tomcat to lock up.
Contrast this to my PHP based applications (WordPress for example) and I have yet to experience a problem.
THE JAVA FACADE
The Java community loves design patterns (they need them with that overly engineered Frankenstein of a language …) so I’m sure they’ll understand this -> Java is heavy, whenever you start a Java process it like putting on 50 pounds – it slows you down.
The Java facade is the claim that Java is a light nimble thing … the JVM that is. It is not anymore. It once was say back in 1997.
I always wondered why Sun (a billion dollar company) could not get Java Applets to work whereas the relatively tiny company Macromedia, could with the Flash player?
… I’m ranting, so sorry.
CPANEL IS SCARED OF JAVA
Funny, when you activate Tomcat to work with a domain on CPANEL, it gives you a warning about how much juice Java swallows up … and warns against enabling too many Java based websites. It doesn’t say jack about PHP …
JAVA’S FUTURE IS IN LEGACY
It seems a contradiction, but I think that’s where it’s at. Java will become (strictly) a technology of the Enterprise (and legacy integration) while nimble languages like PHP and Ruby will be used to create the new innovative software.
Why?
PHP and Ruby programmers can (and do) code circles around Java developers. You can’t blame the Java developers: the Titanic couldn’t turn on a dime either!
Zing!
read more
August 13, 2006

I just a released a new video (in a larger format) on forms and PHP at www.killerphp.com
You can check out the details (and the video) at www.killerphp.com
Part 2 (coming out soon) we will get into practical PHP code.
CIAO,
Stefan Mischook
read more
August 2, 2006
I wrote my first script back in 1996 – some really simple JavaScript that validated HTML forms and presented users with ugly ‘alert’ boxes when errors occurred.
I always wondered why on Windows, ‘alert’ boxes looked so ugly?
… they probably looked good on Macs though.
Since then, I’ve written software for business purposes in perhaps 8-9 languages. Over the years, I’ve come across many ways in which people classify languages:
- Object Oriented vs. Procedural vs. Prototype
- Scripting vs. Programming
- Compiled vs. dynamic
… and many more.
Recently a more practical way of classifying languages has come to my attention – classifying languages by problem-domain or in other words, context.
- System Languages
- Architectural Languages
- Application Languages
I like this list, because it really conveys a sense of practical use for a language. I’ve hammered out the details below:
System Languages
… best used to build operating systems, hardware drivers etc. Fast and gives you low level (close to the core) access to the computer. These languages are used when speed is critical.
These languages include:
Architectural Languages
… best used to build frameworks that support (make easy) application building. Not as fast (at run-time) as system level languages, but they provide a higher level of abstraction that makes writing software quicker and more productive.
These languages include:
Application Languages
… best used to build the actual business applications like web shopping carts/stores, connecting to databases and creating the screens for users to interact with the database.
These languages include:
These language all allow for extremely fast development.
Programmers are freed from the low-level details that you have to contend with when working with architectural and system level languages.
The fact that they’re all scripting languages (that don’t need to be compiled,) adds to the ease of use and speed of development.
MY POINT
It makes for an interesting way to look at languages … and our choice of what language(s) to use for a given project.
Stefan Mischook
read more
July 19, 2006
Not a bad book for people who have a little PHP knowledge … but if you are a total programming novice, you will need to get another book … or better yet, my php videos for novices! I don’t usually plug my own stuff … but what the heck.
The thing that stands out for me, is the way the author is able to cover various PHP topics in a concise manner. He has also chosen topics that I think would interest most PHP programmers – they are practical.
Some highlights:
- The section on string manipulation is very good.
- Great coverage on the powerful sprintf function – something you don’t see often.
- HTML form processing (chapter 5) shines.
My only complaint:
… though the book says that all you need to know is HTML, this is clearly not the case. Most web designers will have problems if they try to tackle this book from scratch.
Final comment:
If you have a little PHP background, this is a good book to get. I’m happy to have it on my nerd-book shelves.
read more
July 15, 2006
Killersites.com was first made famous about 10 years ago (1996) when it taught web designers to use design principles when building websites.
In those days, dancing mice and ‘under construction’ animated gifs were common …
Years later (2002-2003,) web designers started to become very aware of the importance of good code, separation of styling (CSS) from structure (HTML/XHTML), usability, accessibility etc…
This may be surprising to some (who may be new to web design) but before then, most web designers barely understood HTML!
WHAT IS THE NEXT STEP?
Today I think the next challenge for web designers, is to learn to program.
I know, I know … many of you are probably have a 1000 reasons why you have no need, and no interest in learning a programming language like PHP or JavaScript.
But consider these few simple points:
- Learning even a little programming will open you to a whole new world of possibilities with your websites.
- Learning to program will teach you to think in new ways that can have great benefits in all aspects of life.
- Learning to program will improve your understanding of web design – it will deepen considerably.
Besides what is listed above (with each being reason enough,) learning to program will give you a very marketable skill … you’ll be worth more!
MY GOAL
I’ve been dancing around the whole programming thing for a while with: the occasional article, video or podcast.
I’ve been slowly ‘priming’ you guys for the big move … the move into highest level of nerdom: programming.
…
My goal is to teach total non-nerd and artsy web designer types, how to write PHP. Not theoretical stuff; useful PHP that you can use in your own web projects.
Don’t worry, I am going to take it slow and do everything in my power to avoid nerd jargon. Or as I like to call it: ‘nerd-speak’.
KILLERPHP.COM LAUNCHED
To get the ball rolling, I’ve created what I call a ‘micro-site’ – a website dedicated to one narrow subject.
In this case, www.killerphp.com is dedicated to teaching web designers (not programmers) how to create database driven websites with PHP.
read more
July 3, 2006
WHAT ARE DATABASES?
Databases are programs that are built to store and manage information. You can think of a database as a virtual filing cabinet – with extra bells and whistles.
Types of databases:
There are several types of databases used today. The most common being:
1. Relational databases.
2. Object databases.
3. Flat file databases.
You can think of each type of database as a different way (conceptual and practical) to store and manage information.
Each type of database has its advantages and disadvantages. That said, by far, the most popular database type is the ‘relational database’. That’s why we concentrate on them here.
WHAT ARE ‘RELATIONAL’ DATABASES?
As I hinted at above, each database type has a different concept on how data/information should be stored and organized.
A relational database stores (and organizes) its data/information by creating relationships between different pieces of information (stored in virtual containers) that are … uh, related to each other.
To illustrate the point: if you had a brother, your mother would be the ‘key’ that forms the relationship between you and your brother.
With this analogy in mind, we can say that a relational database stores and tracks data by establishing relationships by using ‘keys’ (in this case, your mother) that are consistent between two pieces of information – you both have the same mother.
Popular relational databases include:
· MySQL (often used with PHP because it’s free)
· Oracle
· Microsoft SQL Server
WHAT ARE VIRTUAL CONTAINERS?
We all know that it’s much easier to store and find stuff/things (in your home) if you put the stuff into boxes and then label the boxes … much better than just leaving all your junk on the floor.
Though naturally a messy bunch, nerds have picked up on that fact, and realized that computer information should also be stored in boxes (virtual containers) that are labeled. In a relational database, we call these ‘boxes’: tables.
In a nutshell: the virtual containers in relational databases are called ‘tables’ and information is stored in tables.
MORE ABOUT TABLES
Database tables are virtual containers designed to hold and organize data. In many ways they look like spreadsheets where database tables have both rows and columns.
The difference between a spreadsheet (like Excel,) and a relational database table, is that the spreadsheet is designed (has built in capability) to manipulate data for the purposes of presentation – creating charts and reports etc.
Where on the flip side, a database table is designed (has built in tools/capability) to organize and maintain information and it can hold much, much more information than a spreadsheet.
So yes, you can store information in a spreadsheet, but it lacks many capabilities (and capacity) that you would find in a database.
We will learn more about the makeup of a table (purpose of the rows and columns) when we actually build one.
THE ‘RELATIONSHIPS’ IN RELATIONAL DATABASES
As I mentioned above, a relational database stores information in tables (the virtual containers) and then creates relationships/connections between the tables (and thus the data that is stored in the tables.)
This system/method of storing information (by creating relationships,) is efficient because of a few reasons; the most important being is that this style of storing information (in tables that are related to each other,) helps to prevent information from being duplicated needlessly.
A FUNDAMENTAL PRINCIPLE OF DATABASE DESIGN
One of the fundamental rules in database theory/design, is that information should not be duplicated:
… if you have multiple copies of the same information floating around, it takes up more disk space and can easily become a nightmare to organize.
By storing information in different tables, and linking that information to each other (that are related,) you avoid duplicating information. This will become clear when we actually build our first database … I know (that for now,) many of you are probably unclear about a few things … have faith, it will come!
Part 2 coming out soon …
Thanks,
Stefan Mischook
read more