Software Engineer, Music Lover, Geek.

Posts in category PHP

Midwest PHP 2014

Midwest PHP 2014

I recently attended the Midwest PHP conference and it was a truly great experience. I went last year and while the location changed this year the quality of the conference was right on par. This year it took place at the University of St. Thomas (Minneapolis Campus) which proved to be a perfect venue for […]

Conditional Insert / Update With The ...

Conditional Insert / Update With The Eloquent ORM

I have been using Laravel more and more lately (full post on that coming soon) and have really been enjoying the Eloquent ORM. I plan to extend the ORM so that it includes an “upsert” method but in the short term I had a need to check for the existence of a key and then […]

The Midwest PHP Conference

The Midwest PHP Conference

I attended the first ever Midwest PHP Conference last weekend and blogged about it on the Spyder Trap site. Please check out the full post here.

Extend PHP error_log() Functionality

Extend PHP error_log() Functionality

Throughout development many of us use the built-in error_log() function quite a bit. I know I sure do when I am debugging models, controllers, and the such but don’t you hate it when you want to write the contents of an array or object to the error log? The error_log() function only accepts a string […]

Autoload Classes w/ PHP

Autoload Classes w/ PHP

Are you using an object oriented approach with PHP and finding that your memory usage is going through the roof with the more classes that you add? PHP’s autoload() function enables you to automatically load classes when they are used which will greatly reduce the overhead of your application. In addition to the basics of […]

File Uploading With PHP

File Uploading With PHP

This example shows you how to build a file upload handler that lets users select a file they wish to upload along with a name for the file just in case they want to specify something other than the file name. The function then takes the data stream, moves the temporary file to a location […]

IP Checking/Blocking with PHP

IP Checking/Blocking with PHP

Often times in the web development world we need to detect a users IP address and in some cases block them from performing a particular action over a certain duration. For example I built an online donation application a while back and after it had been live for only a matter of days we noticed […]

Using PHP Data in JavaScript Function...

Using PHP Data in JavaScript Functions

I recently built an autocomplete function (using JavaScript) for a publications tracking application which allows users to enter part/all of a tag into an input field and it will automatically suggest completions which can be done as many times as the user wants if they want multiple tags [think Flickr] assigned to a given record. […]

Sanitize Your Inputs!

Sanitize Your Inputs!

We have all heard the term “SQL Injection” before which is loosely defined as a code injection technique that exploits a security vulnerability in the database. So how do we protect against these types of attacks? Sanitize all incoming data that is going to be used in a database. There are a lot of good […]

Date Formatting Functions

Date Formatting Functions

Here are a couple functions I threw together to help with date formatting. One converts an integer month to a string while the other adds ordinal suffixes to day values. The function calls should be pretty self explainatory but if you have questions please leave them in the comments here or shoot me an email.

Categories