Archive for June, 2006

I’ve moved!

Wednesday, June 28th, 2006

Thanks to all that dropped by to help me move out 2 weekends ago. My place is still a mess but at least we’re in our new appartment! Drop by if you don’t mind seeing a giant mess consisting of large boxes, unassembled furniture scattered cat fur (yay!).

You can see where the appartment is located using Google Maps.

Check out pics from the move in my friends section. Username/password: friends.

How to make form data safe for Database storage

Tuesday, June 6th, 2006

Prevent malicious DB injection and faulty automated queries. Read http://us3.php.net/manual/en/function.mysql-real-escape-string.php

In particular, check out the section describing the function: function quote_smart($value)

Display submitted form

Tuesday, June 6th, 2006

When displaying submitted form elements back to the user back to the user (for confirmation or whatnot), use PHP’s htmlspecialchars() to properly encode special characters (especially useful for French or non-english forms as it takes care of properly displaying all the accented characters)

Lesson of the day…don’t run an open proxy

Tuesday, June 6th, 2006

What not to do:

  1. Rent out a new server
  2. Install a new proxy you’re unfamiliar with and run a quick install
  3. Test the proxy out with mIRC, for just long enough to get scanned and marked as an open relay for spammers
  4. Leave the server unattended for 2 days or so…

45,000 spam emails and 7 GB of bandwidth consumption later, expect VERY angry emails from server admins at your datacenter…

You live, you learn…

Separate code from presentation with PHP Smarty

Friday, June 2nd, 2006

Writing robust PHP code means separating your application code from its (X)HTML (or other type of) presentation. Using smarty templates allows you to do just that.

Check out all the details on the Smarty website

 Integrate this with the PEAR’s HTML_Quickform and suddenly you’ve got a robust framework for powerful form-based applications.