AJAX Form Submit with CakePHP 2.x

CakePHP has some great tools for a PHP developer to crank out JavaScript functions using only PHP. The JsHelper supports Prototype/Scriptaculous, Mootools/Mootools-more, and jQuery/jQuery UI. Refer to the CakePHP Book for details on all the functions provided by the JsHelper. In this example we're going to look at a creating a contact form that submits via AJAX, but also works properly for users without JavaScript.

Writing Secure Code with CakePHP 2.x Forms

CakePHP is one of my favorite web frameworks. There is one glaring security hole that caught my attention though. Without proper care from the developer, users have the potential to tamper with data sent with forms. For example, a common operation is to take the value from a form and save it like this:

$this->User->save($this->request->data['User']);

Let's say the user manipulates the form and adds this line:

Responsive CSS Media Queries

Responsive design has been a big boom recently and it's still a mystery to some. Let's see just how easy it really is. Let's say you want to start simple with a normal desktop version of your website and one suitable for smaller screens like mobile phones. Let's start with something like the menu. You can create one menu and set it to display for large windows and make a compact menu, perhaps a dropdown, for smaller screens. This is where CSS Media Queries come in. In the HTML there can be two different menus created with only one set to display at a time.

Twitter Bootstrap Review

Twitter Bootstrap, which was renamed to simply Bootstrap, is am amazing tool for web developers. It is now my favorite way to get a new site going. As a developer, I feel it is powerful and flexible, but not bloated. It is just the right tools for almost any project. Check out their official website here. It comes in a very light and simple package that includes:

Google Analytics Event Tracking in Drupal 7 (Hooks & OnClick)

Event tracking with Google Analytics has pretty much become a standard on all new sites. Google provides ample documentation on using the analytics, but the tricky part is getting it to integrate the way you want with Drupal. The Drupal Google Analytics module offers basic functionality out of the box. It can track page hits, specific user roles, offsite links, and download clicks. It also supports custom variables using tokens.

Chrome Extensions for Web Developers

There are many 'Top X useful extensions for web developer' posts out there. The problem I have with them is that they recommend multiple modules that do the same thing. For example, the 'web developer' and 'pendule' modules both offer a color picker tool, so I don't really see the need for another special extension just for color picking. Same with browser resizing, why would I want 3 extensions installed for that? Also, everyone should already have a method of taking screenshots (full or partial.) Even Windows comes with a basic snipping tool that does a perfect job.

16 Recommended Drupal Modules

These 16 recommended Drupal modules are not all recommended for every project, but they among the more useful modules out there. Many of them are useful only for site developers.

Admin Menu - An improved admin toolbar with drop down menus.

Backup Migrate - A must have for importing/exporting Drupal databases. Conveniently omits the data from the cache tables. Admins can schedule regular backups on a timed basis.