PHP
Get the fulll URL of the current page
Submitted by jebaird on Sat, 09/19/2009 - 16:05Here is a simple function that will get the url of the current page.
Caching Dynamic PHP Pages Easliy
Submitted by jebaird on Fri, 04/10/2009 - 20:05Over the past month or so I have been toying with the idea of developing a way to cache dynamic PHP pages with out a lot of overhead. I stumbled across this blog entry: http://papermashup.com/caching-dynamic-php-pages-easily the idea was so simple it was almost too easy. So I took it upon my self to turn the original code and some of the user comments code into a class. I have made some minor changes(cleaned up if statements, fixed a bug dealing with the cached version of the page not getting serve
which statement is faster, elseif() or switch() ?
Submitted by jebaird on Mon, 12/01/2008 - 01:00A couple of days ago I was out on a run and I starting wondering which statement was faster, a elseif() or a switch(). I am a big fan of switch statements. I like how clean they look and its really easy to add a new condition to them. I also assumed that they were much quicker than elseif statements. So I set up this test to try to prove to myself that I was right.
Php MySQL pagination with one database query
Submitted by jebaird on Thu, 06/05/2008 - 00:00Pagination is one of the simple features of a site if used right can be a great feature. For something very simple it seems to be a resource hog. For a while I have been looking for a way to paganate with out issuing two database queries. After some quick searching I could not find what I was looking for, so I came up a method that uses a one query + a sub-query.
Quick Review
The method that I have seen the most, looks like some like this.