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…
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…
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,…
February 1, 2009 Comments Off
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…
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…
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…
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…
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…
Heres Part 2 of the jQuery AJAX login tutorial. If you haven’t already, i suggest you read part 1 located here.
We are going to start writing the PHP code to process the form. This is fairly basic stuff, using $_POST to get the values from the form, then checking them against pre-assigned values, if they match, then echo approved, if they…
Heyo. This is going to be the first of 4 tutorials on making a jQuery powered AJAX login system with a PHP backend. The series of tutorials will go like so.
- Plan, code the form (This tutorial)
- Code the PHP backend, make it work
- Code the AJAX, implement it.
- Tidy it up, make it look snazzy
Ok then. So we will have a forum with…
In nearly all of my PHP tutorials you’ll see me using the secure function to sanitise incoming user data from things like forms, and $_GETs . Its a small function, which no doubt alot of you already have, but here it is anyway.
function secure($string) {
$string = strip_tags($string);
$string = htmlspecialchars($string);
$string = trim($string);
$string = stripslashes($string);
$string = mysql_real_escape_string($string);…