6 projects every PHP developer should use

December 25, 2008
6 projects every PHP developer should use

6 projects every PHP developer should use

As a php web developer, you should know that php is probably the language that has the biggest code repository. So no matter what module you want to include in your project there should be an open source solution.

This can help in various ways, but just in case you can’t think of one, here I put a few :

  • Open source is worked by many people, so the result is for sure better than one man’s work
  • You can have free updates to your code, while otherwise you should code the updates each time something new comes up
  • You save development time while your project is getting better

Anyway, after many years as a web developer, I’ve compiled a list of php classes that can be easily integrated in any project and I am regularly use.

Sending Emails
Sending emails is something very common for every web site. Php’s mail() function is good for this, but what if you want to attach a file, or send through an SMTP server, etc? Well in that case you should use phpmailer

User Manipulation
Another common module is the user module. With that you can manipulate users (login, logout, register, etc.) Personally I’ve never found a project that is good enough, so I created my own.

Php user class is a module that can be used even in established projects, as it uses variable data for database tables, fields, session variables, etc.

Fetching RSS Feeds
Ever wanted to fetch an rss feed from your project? Well there is always an easy way to fetch a feed but in most cases you need more than that. When that is the case you should definitely use Magpie RSS .

Template System
Another thing that all sites use is a template. A template engine can save you lots of time, while it can make display changes very easy. A complete template engine that most projects use is Smarty.


BBcode used to be a functionality for forums, but as more and more sites use it in order to be more friendly to their users, you might want to use BBcode to your site. The problem is that BBcode requires a lot of coding and I am not sure if you have the time for this. If you don’t you’ll find StringParser_BBcode class very useful.

Paypal Payment Integration
As you may know paypal has a nice API for developers who want to integrate paypal payments in their sites. The paypal IPN integration class helps you make use of it and start accepting payments in 20 minutes.


What is clustered hosting?

December 21, 2008

In a traditional web hosting environment, your site and its associated data will be located on one server in one location. This can cause problems if your server goes offline or the datacenter where your server is located burns down. So what’s the solution to this problem? Clustered hosting.

Clustered hosting offers a 100% uptime solution for sites that need it most. Instead of one server, your website depends on the resources of multiple servers. These servers are generally located in different physical areas. If one of them goes offline, the other servers in the cluster will pick up the load, assuring that your site stays online.

Clustered server hosting is also beneficial for extremely large, high traffic sites. Since multiple servers are handling the load balance, security and data resources, your site will run with greater efficiency than if it were on a single server.

This type of hosting is not for those on a budget. A clustered hosting solution is created specifically for a single site or network of sites and can be fairly expensive, depending on the amount of resources needed. Clustered hosting providers can give you a quote if you know what you need and will work with you in order to figure out the optimal solution at an affordable price if you’re not quite sure what kind of setup you’ll require.

5 Ways to be a Better PHP Developer

December 16, 2008

Often, an inexperienced PHP developer will hop onto IRC and ask a question in ##php on Freenode. And if the question is trivial, the answer seems obvious or they simply seem like a newbie, they may soon find themselves bombarded with such comments as “RTFM”, “Go learn PHP”, “We are not your personal tutors” or simply “You need to become a better PHP developer”. So, how is it that one becomes a better PHP developer? In this post, I’ll outline five ways to be a better developer, improve your productivity, write less code and achieve more with your web applications.There’s always more to learn when it comes to PHP development. New core functions, new frameworks, new design patterns, new code documentation styles. Here are some of the best ways you can become a better PHP developer.

1. Read the manual
I really can’t emphasize this enough – there’s a lot to be learned just reading the PHP manual. Especially check out the string and array functions. There’s a lot of functionality available right there, and often by reading through the manual you’ll find you’ve been reinventing the wheel in past projects when you could have just used a core function. The manual is your friend.

2. Browse through some code
PHP has a lot of open source code out there. So why not learn from it? Download an open source PHP application and have a read through the code. The bigger projects are probably better, as they’ll have more complex structures and systems in place but also more thorough documentation explaining it all. Check out SourceForge.net if you can’t find a good place to start.

3. Learn a new framework
There are more PHP frameworks out there than you’ve had hot dinners; a lot of them are open source and available online if you know where to look. Try the major ones first – phpframeworks.com has a good list. Your framework can never be entirely complete, your next job may require a different framework and you might just find the functionality of another comes in handy in one of your projects.

4. Research
You’ve probably heard a lot of terminology and discussed in the context of PHP web development. From OOP to MVC, KISS to DRY, YAML to INI, even REST to XML-RPC, there are hundreds of technical concepts out there that could directly relate to your work. You may have formed a basic understanding of them, but do you really know what they are or what they mean for you? Spend some time doing real research; Wikipedia is a good place to start. You’re bound to learn something new.

5. Learn OOP
Maybe this follows on a little from the previous point, but OOP is more important than you think. Do you really know about PHP5’s implementation OOP? For example, are you familiar with abstract classes, interfaces, the implements keyword, static methods and properties, the ‘protected’ access modifier? Even many experienced PHP developers fall down in this area. If you make use of the features of OOP, you could save yourself a lot of development time.

So there you have it. Five, straightforward yet significant ways to be a better PHP developer.

Few things you must never do when quering database

December 13, 2008

I’m putting this in here because I’ve done it myself and I’ve seen it done by others.
NEVER EVER use mysql_query() in a loop (like while(), for(), foreach() … ). It will slow down your script and drive you nuts. It’s the wrong way of doing anything you have in mind.

Another thing is using union(). If you have one big mysql query and you union the results of that one with some other query, well, that is going to be a hard bone to chew for your web server. Same thing applies to joins. The more joins you will use in your query, the longer the server will take to process it and the more resources will be consumed.

Sometimes, instead of a join is better to use 2 different mysql queries that will give the same result. It’s up to you to decide what the scenario will be. But you must always remember that if an application runs well with 100 rows in the database, that will change when you’ll have 10.000 rows.

How domain names are deleted

December 11, 2008

Ever wonder how a domain name gets deleted or “dropped”? The domain drop process is long and arduous and there are many steps involved. Here’s how the process works:

  • After a domain name expires it enters an on-hold period. The domain name owner is allowed to renew the domain at any point during this time frame. Depending on the registrar, the on-hold period can last anywhere between 1 and 45 days.
  • Next comes the grace period. The domain owner is still able to reclaim the domain during this time, but will usually pay a hefty recovery penalty or fee to do so. The grace period usually lasts 30 days, but again, this depends on the registrar.
  • After a domain name bows out of the grace period, the owner has no chance to re-register or re-acquire it. The domain is marked as pending deletion and will be available to the public for registration within 5 days.
  • The domain is now free to be registered by anyone through a domain name registrar.

So how do everyday people find deleted domain names, dropped domain names and expired domain names? By using a deleted domain search service such as DeletedDomains.com! Deleted Domains allows users to search through the latest lists of on-hold domains and deleted domains. The lists are updated daily and the site also provides an extensive search option and daily email alerts for domain keywords.

The oreginal artical here

List of PHP editors

December 9, 2008

When you start to learn PHP programming you will need an editor to write your code with and there are plenty of them out there for you to choose from and use.

In this tutorial I am going to list some of the most commonly used PHP editor tools and some information about them. Hopefully any new coders can then try out some of them and decide on what is best for them.


First of all NotePad++ is completely freeware .

Some Features :

  • Auto-completion (language and file)
  • Bookmarks
  • Syntax highlighting (and brace and indent highlighting)
  • Regular expression find and replace
  • Split screen editing
  • Zooming
  • Spell checker (built in but requires Aspell)
  • Hex editor (plug-in available, no longer included in standard installation as of v4.8.2)
  • Tabbed document interface
  • FTP Browser (plug-in included in standard installation)
  • Support for various file formats including unicode.

Edit Plus

EditPlus is a text editor, HTML editor and programmers editor for Windows. While it can serve as a good Notepad replacement, it also offers many powerful features for Web page authors and programmers.

Some Features :

  • EditPlus supports powerful and customizable syntax highlighting for the a lot of programming launguages.
  • FTP commands for uploading your local files to FTP server or for editing remote files directly.
  • Auto-completion
  • Line number, ruler, column selection, powerful search and replace, multiple undo/redo, spell checker, customizable keyboard shortcuts, and more.

Eclipse with pdt

The PDT project provides a PHP Development Tools framework for the Eclipse platform. This project encompasses all development components necessary to develop PHP and facilitate extensibility. It leverages the existing Web Tools Project in providing developers with PHP capabilities.

Some Features :

  • Intuitive and easy to learn
  • Seamless integration with the Web Tools project
  • Adherence to Eclipse standards
  • Extensibility
  • Continuous support of PHP developments

There are literally hundreds of editors out there for coding in PHP and what works for you is a matter of personal choice.
I have focused on Windows platform editors here, however there are many great applications on other platforms.

http://en.wikipedia.org/wiki/List_of_PHP_editors is a good place to start if you are not running on Windows and there are some further applications for each platform here that I implore you to explore.

Happy Coding……

Inroduction to MYSQL [Lesson 1]

December 8, 2008

Welcome this My first tutorial in MySQL i hope you find this tutorial useful…. OK lets start.

MySQL is currently the most popular open source database server in existence. On top of that, it is very commonly used in conjunction with PHP scripts to create powerful and dynamic server-side applications.

MYSQL Syntax

One of the greatest thing about MySQL is that the “code” is very easy for humans to read, as opposed to harder programming languages like C or C++. Very few special characters and symbols are required to create a MySQL query, and most queries uses simple English words!

How To Learn MySQL

The MySQL language is not as complicated as most programming languages, so the best way to learn is with direct examples. Because this tutorial focuses on the combination of MySQL and PHP, most of the examples are ready for you to copy, paste, and run on your web server.

Good Programming Habit

There is a lot of keywords in MySQL  and its a good programming habit to capitalize them when you are using it in your program or script .

  • $query = mysql_query(“SELECT * FROM example”)

That line of code is valid PHP, but it also contains valid MySQL. The text that appears between the quotations “SELECT * FROM example”, is the MySQL code.

As you probably can tell “SELECT” and “FROM” are the MySQL keywords used in this query. Capitalizing them allows you to tell from a quick glance that this query selects data from a table.

You can view a complete list of MySQL keywords at List of Reserved MySQL Words, but don’t worry about memorizing them. You could program relentlessly in MySQL for years without ever using all of the MySQL keywords.

That is all for this tutorial, sett back and read more about MySQL database and wait for the next tutorial until that time … goodbye… see you .