logo
Currently Browsing: PHP
Jun
4

PHP detect homepage

I won’t lie, I am mainly writing this blog post for me as I always seem to forget this simple code for some reason! I also thought there was a good chance others may be in the same boat as well so that sealed the deal. This script is particularly useful if you have included pages across your entire website (such as a navigation) and wish to include something in this section for the homepage only (such... 
Mar
28

php inline error reporting on

There are going to be times when you are faced with a blank screen and a wave of frustration! Welcome to web programming. I know C programmers are going to argue that the pitfalls of php programming are nothing when compared to segmentation faults and memory leaks, but never the less it is very frustrating when you are developing and PHP error reporting isn’t turned on. Whenever I am faced with an empty... 
Nov
29

10 Productive PHP Tools for Testing and Debugging

There’s more to testing than just unit testing. Here are 10 wide-ranging testing and debugging utili … PHPBuilder.com New Articles  Read More →
Nov
28

Implementing the Singleton Pattern in PHP 5

Integrating design patterns into your PHP applications can lead to performance issues if you don’t d … PHPBuilder.com New Articles  Read More →
Aug
12

Simple PHP ad rotator

It’s pretty common to want to rotate between ad’s or content. You may want to have a mix of adsense and some CPM, or you may just want to swap between a picture of yourself and a tree. Here is a neat little switch statement that will allow you to rotate an ad/content every time the page is refreshed: <php //rand returns a number between 0 and 2 inclusive $choice = rand(0, 2); switch ($choice)... 

logo
Powered by Wordpress | Designed by Elegant Themes