This is a very quick way to add password protection to a controller such as a cms controller. This code intercepts the login within the init() method of your chosen…
Author: Adrian
session_start hangs when it used to work
I had a problem with my zend application hanging with a white screen for no reason. I narrowed it down to when $adminSession = new Zend_Session_Namespace(‘Admin’); was executed, this is…
ckeditor to upload images
A few posts on how to do this, and a lot of frustrated people so here is how: Download both ckeditor and ckfinder. Decompress them into the root directory. Include…
database class php
Updated the database class Usage: // min instantiation $dataBase = new DB(‘hostname’,’username’,’password’,’database’); // max instantiation $dataBase = new DB(‘hostname’,’username’,’password’,’database’,DEBUG_LEVEL,array(‘admin@domain.com’,’admin@domain2.com)); Class: class DB{ /* * DESCRIPTION: Object class, Handles all database…
compile your own lamp stack with mysqli
Install LAMP with one line One liner sudo apt-get install lamp-server^ Add CURL and enable mod-rewrite sudo apt-get install php5-curl sudo a2enmod rewrite To compile LAMP with mysqli and mysql…
simple mvc
Need a lightweight, fast, php mvc framework? I have written a small framework named “Simple MVC” it does exactly what it says on the box, its quick to install and…
sort a array by its value
To sort an array by its value, similiar to mysql sort by just use usort($array, create_function(‘$a, $b, $sortBy=”distance”‘, ‘return strnatcmp($a[$sortBy], $b[$sortBy]);’)); $array stores the array $sortBy set the key to…
styling form buttons with divs
Styling a button inside a form with multiple div`s to achieve a curved button with click events etc, can be done relatively easy with the use of javascript. firstly lets…
wordpress comment count as a button
Styling the wordpress comment count as a button/icon etc can be tricky because the normal call to the comments comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’)); formats the output as an…
ftp open in explorer by default in windows
How to make explorer open by default when opening an ftp connection, I found can be easy.. I needed to make IE6 style FTP access without the extra pop up…