Apache, SSL, Red Hat 4

July 2, 2009 – 5:46 pm
A new requirement came down for the Solo Tech application the other day. We need to serve it using SSL and in addition the SOAP calls to the API need to use SSL as well. There was a lot of hoop jumping in order to get this working. I had ...

Installing Apache and PHP on Red Hat 5

June 23, 2009 – 6:19 pm
As part of building up my dev environment at ETI I had to install Apache2.2 and PHP5 on Red Hat 5. Here are my install notes. Do this as root. First download the source for Apache and PHP. This command will get the file from the URL and put it at your ...

Class Loader

February 16, 2009 – 1:59 am
I needed a class loader for my little framework as I dont want to include all the files in on every request which is what listing them in a long list of includes will do. So I checked out the PHP.net site which has this code sample. I used it ...

Mod_rewrite

February 16, 2009 – 1:54 am
I wanted to start a small MVC framework to help build my next project. I needed to get mod_rewrite working and also build a simple class loader. For mod_rewrite I setup the following .htaccess file (xp.htaccess to get around Windows' filename issue) RewriteEngine on RewriteCond %{REQUEST_URI} !\.(php|css|js|gif|png|jpe?g)$ RewriteRule (.*)$ /index.php [L] Then in my dispatcher ...

Zend Framework

February 11, 2009 – 1:31 pm
Anthony suggested that I try out the Zend Framework. It's a pretty simple installation but I had a hard time findinga decent tutorial. The simple starter on the Zend site is set up to use SQL Lite and I just did not feel like installing and learning that at the ...

Apache Virtual Host on Windows XP

February 3, 2009 – 12:22 am
I wanted to set up some virtual hosts in my local environment. I found this very helpful page. Here is the lesson in a nutshell. Assuming Apache 2.2 is installed in the default location open the following file: C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf Find the lines that read: # Virtual hosts #Include conf/extra/httpd-vhosts.conf and remove the comment ...

Autocomplete field with jQuery and PHP

January 11, 2009 – 8:10 pm
For the recipe manager project I need to allow the entering of ingredients that the system does not know about. I decided to use an auto complete field to allow users to easily see what was already in the system. If the ingredient does not exist then the one they ...

jQuery solution to the add ingredient row problem

January 4, 2009 – 7:28 pm
Due to the fact that I could not find a reasonable solution within the CakePHP framework to add a new row of ingredient list inputs to recipe form I solved the problem using jQuery. This is the script. $('#add_ingredient_row').click(function() { // Clone the last row of the table. var clonedRow = $("#ingredient_list tr:last").clone(); // Generate an ...

MySQL Workbench

January 4, 2009 – 2:36 am
Today I was going crazy trying to figure out a foreign key issue. So I found this great tool that reverse engineers a graphic model from sql statements. Very cool! It even outputs the model as an image.

Basic user authentication

January 3, 2009 – 4:00 pm
Today I got the basic user authentication going for the Recipe Manager using this tutorial. Users Controller class UsersController extends AppController { var $name = "Users"; //var $helpers = array('Html', 'Form'); function index() { } function beforeFilter() { $this->__validateLoginStatus(); } function login() { if(empty($this->data) == false) { if(($user = $this->User->validateLogin($this->data['User'])) == true) { $this->Session->write('User', $user); $this->Session->setFlash('You\'ve successfully logged in.'); $this->redirect('/recipes/'); exit(); } else { $this->Session->setFlash('Sorry, the information you\'ve entered is incorrect.'); exit(); } } } function register() { if (!empty($this->data)) { //Sanitize::clean($this->data); $this->data['User']['password'] = md5($this->data['User']['password']); $this->User->create(); // ...