How-to: Basic Chat App w/ PHP, jQuery & Ajax

Posted on July 24, 2012 by Jimmy K. in Projects, Tutorials.

One of my friends recently asked for assistance with a chat application he’s developing and, while his is a bit more robust than the one I set out to create, I decided to build one from the ground up to wrap my head around it. The code below took a few hours to compile, but [...]


My Preferred XHTML Template

Posted on April 19, 2012 by Jimmy K. in Articles, Tutorials.

During my internet travels, I have gathered bits and pieces of code and have compiled my preferred XHTML template for starting new projects into this article for anyone looking for new tips and tricks. Some readers might agree with this article and some might disagree with it. In either case – that’s okay! Here it [...]


How-to: Fix Gmail displaying gaps between images.

Posted on April 10, 2012 by Jimmy K. in Articles, Tutorials.

An interesting thing happens to graphic emails when viewed with Gmail. Say you have a graphic email (click here for an example) that you sliced up because you want each piece to link to a different URL, then you piece them all back together using tables to make it look like it did before you sliced [...]


How-to: Set up Google Apps for your domain.

Posted on April 5, 2012 by Jimmy K. in Articles, Resources, Tutorials.

Step 1: Sign up for Google Apps. By signing up for the free version of Google Apps, you are allowed to create up to 10 accounts without paying anything. Ignore the shouts for the $5 Google Apps Business plan – we just want the free stuff. Here is the link for the free version of [...]


PHP: Check if an email address exists.

Posted on March 9, 2012 by Jimmy K. in Tutorials.

As some of you may know, I built and run a small email marketing application. Some of our clients’ lists are as old as dirt, so one of the services we provide is a simple test to determine whether or not an email address actually exists. This function goes through all the normal steps of [...]


PHP: Detect the user’s operating system.

Posted on March 9, 2012 by Jimmy K. in Tutorials.

I wrote this function as a companion to my jDetectBrowserType() function. I rarely need to use it, but it’s good to have in your arsenal just in case. This function will return the user’s operating system as a string and supports the most popular desktop and mobile operating systems. An example of this function can [...]


PHP: Detect the user’s browser type.

Posted on March 9, 2012 by Jimmy K. in Tutorials.

At some point you may need to know the user’s browser type to handle browser-specific events. Most likely, this information will be used to determine which CSS properties you can use to make a web page display the same across all browsers. This function will return the user’s browser type as a string. In the [...]


PHP: Create zip files using ZipArchive.

Posted on February 21, 2012 by Jimmy K. in Tutorials.

PHP has a pretty neat built-in class called ZipArchive that lets you create zip files on a web server at run-time. In a recent update to the END[SEVEN] Cloud, I completely automated the packaging process for downloadable class files and examples using the ZipArchive class. How to use this function: This function accepts an array [...]


PHP: WonkyMail class for sending email.

Posted on January 10, 2012 by Jimmy K. in Projects, Tutorials.

This class has been four years in the making. It started as a very simple script when someone asked me to create a way to send email messages between users on their website. Over time, more features were added until it ultimately became what it is today. This class presently supports multiple file attachments, multiple [...]


PHP: Calculate a person’s age.

Posted on January 9, 2012 by Jimmy K. in Tutorials.

Sometimes you’ll need to calculate an age. It could be the age of a member on your website… It could be your cat. Either way, this can be useful for a variety of reasons such as personalized messages, criteria-based marketing or any functionality that is based on age demographics. I’ve seen a few different versions [...]


PHP: Implode an array into a readable format.

Posted on January 9, 2012 by Jimmy K. in Tutorials.

I was recently asked to write a function that implodes a list of items in an array into a human-readable list. For example, [[0] => “Jimmy”, [1] => “Ryan”, [2] => “Ken”, [3] => “Barbie”] would become “Jimmy, Ryan, Ken and Barbie” and [[0] => “apple”, [1] => “banana”] would become “apple and banana”. This [...]


PHP: Validate email address format using RegEx.

Posted on January 9, 2012 by Jimmy K. in Tutorials.

Email addresses are used for pretty much everything. Registrations, usernames, lead generation… Everything. They are as unique as a telephone number or physical address and require validation just like any other piece of data. I’ve come across a lot of poorly written email validation scripts, but this one has risen from the ashes in a [...]


PHP: Auto-hyperlink URLs using RegEx.

Posted on January 9, 2012 by Jimmy K. in Tutorials.

Have you ever typed a URL into an email or website and a clickable hyperlink was automagically created? Regular expressions, baby! Check it out: This function accepts three arguments; $sInput, $sTarget (optional), and $sClassName (optional). $sInput is the text you would like to search and create hyperlinks for, $sTarget is the target window that hyperlinks [...]


PHP: How to truncate characters and words…

Posted on January 9, 2012 by Jimmy K. in Tutorials.

Sometimes you just need to shorten that huge wall of text. Here are two functions that I use frequently to limit the display of lengthy user input: The first function, jTruncate(), truncates text if it is greater than the specified number of characters. For example, if you pass “This is a large block of text!” [...]


PHP: Recursive Cleanup (for Web Servers)

Posted on October 4, 2011 by Jimmy K. in Articles, Tutorials.

For as long as I can remember, I’ve loathed .DS_Store and Thumbs.db files. They always seem to crawl their way onto my hosting servers. By definition, the .DS_Store file is “a hidden file created by Apple’s Mac OS X operating system to store custom attributes of a folder such as the position of icons or [...]