Archive for the “PHP” category

PHP Include Injection and Google Referral Hijack

by Mark Sanborn on December 3, 2008

So recently a friend of mine, had a client that had a very odd problem. His website was working fine when you go to it directly by typing in the domain name; however, if you searched for the site in Google and clicked the link for the site it would take you to a hijacked (…)

Random Password (String) Generator for PHP

by Mark Sanborn on December 2, 2008

Random string generators are something we programmers end up using quite a bit. Sometimes you want to generate a random file name, a random email verification link, a random password, random token, etc.. Here is the one that I have been using lately. This password generator uses the Mersenne Twister algorithm to generate random digits. (…)

Printing a Label for USPS with PHP

by Mark Sanborn on December 1, 2008

If you have been following the posts on USPS you should know how to calculate USPS shipping rates with PHP. Today we are going to use the same USPS API to print out a label. One of the advantages of this is that you get free tracking on all priority shipments when you create your (…)

Why I use the Zend Framework

by Mark Sanborn on November 25, 2008

Frameworks seem to be popping up all over the place for all sorts of languages. These frameworks all have one goal. They are looking to reduce development time. Time is money and when you are working on client’s sites frameworks can drastically reduce the development time. For this reason frameworks are not going away any (…)

Validating an Email Address With Zend Framework

by Mark Sanborn on November 24, 2008

Email addresses are one of trickiest input types to validate because there are multiple ways emails can be written according to the RFC2822 specification. You could have me@gmail.com, or me+spam@gmail.com, or “mark@server”@marksanborn.net, common on Linux/BSD systems. A lot of times people will use a regular expression like: (\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6}) This regular expression would work for almost (…)

Validating Credit Card Numbers with Zend Framework

by Mark Sanborn on November 21, 2008

Ever wonder how websites can tell you made a mistake entering your credit card number before you even submit it? Like most identification numbers credit cards have checksum digits built into them. Just like barcodes. If you ever look at a EAN-13 UPC barcode (on all retail products) you will notice there is a digit (…)

Setting Up a Sandbox Server with SVN

by Mark Sanborn on November 6, 2008

SVN is one of those things that you love once you know what and how it works. SVN is a version control system used by almost all major open source projects and is an absolute dream to work with. If you have ever worked with a team of developers you probably have had the experience (…)

New UPS PHP Project at Google Code

by Mark Sanborn on October 9, 2008

Out of popularity I have decided to take UPS modules written in PHP found in my article, Calculating UPS Shipping Rate with PHP, over to the next level. I am rewriting all the code in object oriented PHP and publishing the code on Google Code under GNU General Public License v3 to ease implementation. I (…)