J Cornelius

articles

Credit Card Obfuscation in PHP — February 2, 2005

Recently while writing some billing functions I came across the need to show customers the credit card number on file for their account. Since most people would freak out if I showed them the entire number I had to make a quick function to obfuscate the number and let them know what type of card they previously used. Here is a quick way to do just that. This function is super easy to use... continue »

Solving IE Image Flicker — October 10, 2004

Using classic FIR or similar Image replacement techniques is fabulous except that IE doesn't follow the rules on image caching and CSS. Here's how to configure your server to force IE to behave.Thanks to Dean Edwards and Ryan Carver for figuring this out. It took me a while to find the two pages linked above so I've included this here for fast reference. Here's a lightweight overview: ... continue »

Hex Color Code Chart — September 22, 2004

When specifying colors in HTML or CSS it's best to use the hex code which is something that browsers understand and convert into colors. Choose a color from the list below and look to its right to get the hex code. If you wanted a nice blue for example, you could use "#0000cc". You can print this chart if you like, just make sure that "Print background colors and images" option is on in... continue »

Outsourcing Tech Support — August 13, 2004

Article written for the 2004 Shareware Industry Conference discussing the pros and cons of using outside technical support for your company. More than Meets the Eye When considering outsourced technical support for your company or organization there are generally two perspectives that need to be examined. That of your company and more importantly, that of the customer you service. ... continue »

Check and Restart MySQL with a Cron — August 9, 2004

If you have a MySQL powered website it is critical that the MySQL Server is running. This little diddy will check to see that the MySQL Server is running and restart it if it's not.You will need to add an entry to your crontab that runs on a interval you are comfortable with. This example runs every minute although you can set it to run as often as you like. The command is very low on system... continue »

Search Engine Strategies — July 7, 2004

Article written for the 2004 Shareware Industry Conference discussing search keywords and how minor changes in keywords can effect search results, tips and techniques on increasing search ranking, and the cost-effectiveness of paying for keywords. Effective Keyword Selection: Choosing search terms can be tricky business. You have to find terms that are relative to your product or... continue »

Change MySQL root password — June 5, 2004

This is the 'hands-on' way of changing the root password for your MySQL server. Get to a command prompt on the MySQL server and enter the following commands: mysql -u root mysql > UPDATE user SET password=password('secret') WHERE user='root'; > flush privileges; This should reset the password for you and then you can log in and get some real work done. continue »

Apache Server Response Codes — April 17, 2004

Even a seasoned developer can forget the standard response codes for the Apache Server. This list will refresh your memory. If you are looking to customize your 404 pages check this out Successful Client Requests: 200 OK 201 Created 202 Accepted 203 Non-Authorative Information 204 No Content 205 Reset Content 206 Partial Content Client Request Redirected: ... continue »

Always add WWW to your URLs — February 19, 2004

It's always a good idea to have all the traffic for your site go to www.yourdomain.com. Through the magic of Apache mod_rewrite, you can keep your URLs clean and tidy. Often times people will just type your domain name (i.e. "yourdomain.com") into their browser to get to your website. This can cause some interesting and undesired issues, especially if you plan to do any detailed log... continue »

Converting Seconds in PHP — January 14, 2004

All of the conversion functions that I found seemed really bloated. Here is a nice clean way to convert seconds to a more user friendly hour:minute:seconds format. This example takes the current Unix time and converts it to the desired format. Of course you can use this for just about any application that requires you to convert seconds to a more readable format. $seconds = time(); $time =... continue »