Book Review

PHP in Action is a book aimed at people who are comfortable coding procedural or object orientated PHP scripts. It doesn’t teach you what a variable is or what function to use if you want to connect to a database but it does teach you design patterns, best practice techniques and useful information about PHP5’s object system. If you…
Namespaces were introduced into PHP from version 5.3 onwards. They allow the developer to seperate their code into modules or groups which inturn makes the code easier to read. Namespaces prevent class and function name conflicts, it allows you to have numerous classes with the same name, as long as they are in different namespaces. Namespaces also make the old…
cURL is a library written in C that enables easy transfer of data in many different protocols including FTP, FTPS, HTTP, TELNET and LDAP. cURL does more than simply download a file. You can store cookies, upload files, use various types of authentication and tunnel all requests through a proxy. The cURL extension has been bundled with PHP since version…
CodeMirror is an on the fly syntax highlighting engine, written in Javascript. Like CodePress (the syntax highlighter used in the latest version of wordpress for editing plugins), it can highlight many different languages (PHP, JS, HTML, CSS to name a few). This tutorial will show you how to implement CodeMirror on your site, there is a great article written by the…
June 23rd, 2009 / By sourcebits staff /
3 comments
In this tutorial we will create a PHP URL router. The developer using the router will be able to define these routes with regular expressions, these will then map to a file, class and method which will be called – very similar to Django’s routing. By using regular expressions to define our URLs we get maximum customizability. /class/method/ based URL routing…
In large PHP applications you typically see a “classes” directory that only contains classes which are used throughout the application (database, session management, forms etc..). A problem quickly appears: Everytime you wanted to use one of the classes, you would be forced to include() it at the top of the page. __autoload() solves this by automatically including the definition file when a…
May 2nd, 2009 / By sourcebits staff /
1 comment
While there are numerous posts and tutorials detailing web development tools for Windows and Mac operating systems scattered throughout the internet, there are very little for Linux. I’ll show and describe the tools I use to code PHP, Python, Javascript, HTML and CSS on a Linux platform (Ubuntu 8.10). None of these tools are distro specific.
Netbeans
Netbeans is a full featured…
April 18th, 2009 / By sourcebits staff /
4 comments
A Query7 reader requested this tutorial to be written. It’s aimed to be a general guide to build ’something’ using Code Igniter. It uses Models, Views, Controllers, Helpers and Libraries and will give you a good idea how Code Igniter works as a whole. I will be posting more advanced Code Igniter tutorials in the future.
Setup
Install and do some basic configuration…
March 29th, 2009 / By sourcebits staff /
4 comments
What is Code Igniter?
Code Igniter is a PHP web framework which assists in creating complex websites. Unlike other web frameworks, Code Igniter doesn’t force you to use all of it’s components. You select and load them as you require. The only feature you have to use is the URL structuring (/controller/method/) which is very helpful anyway.
Code Igniter follows the Model,…
March 7th, 2009 / By sourcebits staff /
2 comments
Google translate is used by millions of people every day. Combine this with the easy reporting of language errors/mistakes makes it one of the most comprehensive and accurate online translators. Google provides an easy to use API to access their large language database, we’ll be using that today.
It will consist of two textareas, two dropdowns and one button. It will…
February 15th, 2009 / By sourcebits staff /
No comments
Source Control is an essential part of the development system that any and every programmer needs to utilize. Simply put it is a repository of source code that keeps track of revisions and is a system that allows multiple programmers to work on one copy of code without issues. There are numerous version control systems (VCS) out there including Subversion,…
Introduction
RSS Feed consumption has always been a stick point in PHP. Simple Pie is a library that works with both PHP4 and PHP5 that enables you to easily parse and save RSS feeds. Today I’ll show you some common uses of Simple Pie and explain how it runs.
Simple Pie requires:
- PHP 4.3.0 or higher
- cURL Enabled.
- zLib (Caching?)
As well as a few other PHP modules…
January 25th, 2009 / By sourcebits staff /
1 comment
In this tutorial we are going to make a PHP script that archives your website into a .tar file, then automatically moves it to an external FTP server for safe keeping. We can then setup a cron for this script which will execute it automatically every day/week/month , however frequent you want it. This will only work on Linux servers…
January 19th, 2009 / By sourcebits staff /
1 comment
We traditionally think that jQuery’s selector engine can only select elements/information off of the document that we are working on. And AJAX’s only use is to process web forms without the page needing to reload. While both of these are common uses, they are not the only uses. In this tutorial I’m going to show you a not-so-mainstream use of…
December 24th, 2008 / By sourcebits staff /
No comments
As we all know jQuery is a very small language. Not only is the file size of the jQuery library small, but the amount of code you need to write to achieve something is also very small. Because of this it is sometimes more efficient to write and test jQuery code in the browser than in a local file. To…
December 8th, 2008 / By sourcebits staff /
7 comments
This is part 2 of a 2 part series on making a Todo List with PHP and enhancing it with jQuery’s AJAX
In part 1 of the tutorial, we covered the PHP and MySQL side of things. In this part we will be enhancing it with jQuery’s AJAX and manipulation functionality. The to-do list will degrade fine – if the user…
December 3rd, 2008 / By sourcebits staff /
4 comments
This is part 1 of a 2 part series on making a Todo List with PHP and enhancing it with jQuery’s AJAX
In this two part series I’m going to show you how to make a simple to-do list in PHP, and then enhance it using jQuery’s AJAX and manipulation capabilities. This won’t follow any proper coding principles, but will give…
PHP is a very vast language. It’s hard to say that you’ve mastered it. For example, do you know how to crop an image using GD and process web requests with XML-RPC off the top of your head? You may know one of them, but probably not both. That being said, there are a lot of resources out there that…
In an attempt to sharpen up my jQuery, i purchased the book jQuery in Action
by Bear Bibeault and Yehuda Katz. Reading through the book, i could see that the first few chapters were obviously aimed at beginners. They covered selectors (If you know CSS already your fine) and events. You can easily get this information off the jQuery doc site,…
Fedora 9 includes the new package manager called Package Kit. It aims to be the package manager for your system, as it can install apts, slackware packages,rpms and many other file formats. I booted into it and noticed 2 things.
- The first, its incredibly slow – It took along time to download the updates i needed (Slower than downloading a normal…
A stumbled across an amazing online app, meant to be like a CAD im guessing but then i realised the different things it could be used for. Project Draw gives you a grid to start off with, you can then place various shapes onto the grid and resize them. Further more you can add colours, text, gradients, alignments and borders which…
With the arrival of jQuery UI 1.5 i was browsing its’ wiki pages and learning all of the API. I came across the jQuery UI wiki page, its essentially more jQuery effects except these ones are alot more dynamic! You can explode, puff, slide, highlight and alot more. I was a amazed that i hadn’t seen this page or been…
For those of you with no jQuery background what-so-ever, jQuery UI is a series of user interface (UI) enhancements made in Javascript. These range from tabs (which also support ajax loading), to dialog boxes which you can drag, drop and resize. All cross browser! Although its currently still under development the finish line is in sight for the 1.5 release.…
“Whats a good jQuery menu?” is a question I hear quite frequently on blogs and forums. As jQuery is such a simple language to learn, most people code their own for their own sites. I’ve compiled a list of 3 menu plugins, and and 5 ‘custom’ solutions that people have setup.
http://p.sohei.org/jquery-plugins/menu/
Latest release: Jan 07

This plugin was constructed to emulate a…
Coding standards is a very important thing in web development. Code must be formatted in such a way that everyone can read it. Although you start a project on your own and don’t imagine anyone else seeing the source, there may come a time where you sell the site and a new developer will need to work on it. Or…
Adobe Air has been out for around a year, i’ve only just started playing with it. I recorded a video tutorial showing you how to setup a development (using Aptana) and make a very simple application. This method will work for all Operating Systems.
We all know that jQuery is great, that you can do things in 2-3 lines in jQuery that you can in 20 lines of Javascript, but is your jQuery code starting to get a bit bulky? Could you do things better?. I’m going to show you how to reduce a 20-25 line jQuery script into 3 lines by making the…
I recently erased Fedora 9 from my hard drive, and installed Linux Mint. Im enjoying it so far but it didn’t come with a webserver. Heres a little tutorial on how to install XAMPP and get it up and running.
First of all, download XAMPP from sourceforge. As of writing this, the latest version is 1.6.7 so ill be referencing to that…
Woo! Another screencast. In this one i show you how to include your twitter stream into your blog or website, and then format it using jQuery so your tweets have an alternating background colour.
As PHP-GTK2 is fairly new on the scene, there aren’t many resources for learning it. Those that are, are scattered throughout the web. Ive compiled a list below, hopefully they can help you develop PHP-GTK2 applications.