Archive for the 'PHP' Category

Pass multi-dimensional array in ajax request with jQuery

Wednesday, December 24th, 2008

I have a bunch of javascript objects flying around page that interacts with Google Maps, and I wanted to get the data out of some of the objects to pass via a jQery AJAX $.post call to a PHP script. jQuery seems to have everything, so I was surprised there wasn’t any functionality built in […]

Format a MySQL date in PHP

Saturday, December 6th, 2008

I was looking through some very old code of mine and saw the hoops I jumped through to format a MySQL date field into something a little more friendly. It wasn’t pretty, involving explode() among other things. Being more familiar with PHP now, I thought it would be nice to post a snippet of code. […]

Zend_Acl, jQuery and HTTP Status Codes

Wednesday, November 26th, 2008

In my controllers, I use Zend_Acl to check whether or not a user is allowed to perform an action (i.e. should the code in the method be executed). I also have to check permissions once in a method, as someone might be trying to access an object that does not belong to them - i.e. […]

Throw Exceptions

Tuesday, November 25th, 2008

I pushed some changes out from my development server to my production server and ran into an issue with uploading/moving/resizing photos. It only took about 15 to 20 minutes to track down the issue, but it would have been a lot quicker if I hadn’t been sloppy with my code. In using the Zend Framework […]

Zend Controller Error Plugin and 404’s

Friday, November 21st, 2008

The Zend Framework provides a nice plugin to handle errors that bubble up in your controllers. It will automatically route Exceptions to the Error Controller, assuming you have flagged the Front Controller to not display exceptions (which should be the case in a production site). I implemented code for handling the Error Controller that was […]