Archive for December, 2008

Mastering the UPS Shipping API: Rate Shopping Dropdown

One of the first parts of the checkout process of any ecommerce site is to provide the customer with a dropdown box with shipping options. In this tutorial we are going to shop for various UPS rates and display them in a convenient drop down.

If you are new to the UPS API first read this article, Mastering the UPS Shipping API: Getting Started. You will need to have access to UPS’s online web tools. You can register here. Read more »

Auto Pastebin with Pastebinit

If you have ever been in an irc channel or IM and needed to show another programmer your code you have probably used Pastebin before or a similar service. You simply go to the website copy and paste and hit submit and you have a link generated so you can hand it out to your fellow programmer.

I’m always someone that is looking for a faster/better way of doing things and copying, pasting, switching screens, and navigating to a website is a huge waste of time. With pastebinit I can skip all of that and just type: Read more »

Installing Windows IPsec Firewall

Just recently I found a post that described using the ipseccmd in Windows. I honestly had no idea that this tool existed for Windows. I found this article while searching for a way to block outgoing traffic on the local computer as apposed to making firewall policies. This was the perfect solution for network testing, forcing productivity, optimization and security in Windows.

To get the firewall for Windows you will need to download, Windows Support Tools. When installing make sure you select the complete option. Read more »

PHP Include Injection and Google Referral Hijack

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 page.

So the page only appeared hijacked when the referral was coming from Google. The hijack could go unnoticed for months. You would either have to be googleing yourself or wait until a good samaritan sends you an email warning you of the problem. I must say this sort of attack is quite clever on the hijacker’s part. The hijacked page gets the original site’s page rank and Google visits while the site owner has absolutely no clue. Read more »

Random Password (String) Generator for PHP

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. You can learn more about it at Wikipedia or on Makoto Matsumoto’s website. Read more »

Printing a Label for USPS with PHP

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 own label. The other advantages is that you get to integrate automatic label generation with your website for customers or for your own shipping.

Start off by making a file called, USPSLabel.php and copy and paste the code below and save it.

Then Change the userName variable with your USPS username and change the rest of the variables to match your label. Read more »