Archive for the “PHP” category

Finding the Lowest or Highest Number with PHP

by Mark Sanborn on May 16, 2008

Recently I was writing a script and ran into a problem. I needed to compare a set of numbers and find the lowest one. Now, at first I thought that I could compare each one with if statements but I knew there had to be a better way (there always is). If you have 1000 (…)

Calculating USPS Shipping Rates with PHP

by Mark Sanborn on May 14, 2008

If you have a custom shopping cart and you want to calculate actual shipping rates from USPS this is the post for you. After giving up searching the internet for PHP scripts or examples of implementing USPS rates I decided to create my own. I hope that by the end of this post you will (…)

Adsense Split Testing Results for 250×250 vs 300×250

by Mark Sanborn on April 30, 2008

If you remember back to the post I wrote, Using PHP to Determine Which Adsense Ad Works Best, we explored ways to split test the performance of Adsense with the help of PHP. I had also promised to share the results of my testing for the month of April. Below are my results.

Using PHP to Determine Which Adsense Ad Works Best

by Mark Sanborn on March 31, 2008

I recently read an article that discussed the effectiveness of different adsense ad sizes. The three medium box shaped ads that adsense offers is: 250×250 300×250 336×280 The article mentioned that even though the 336×280 was the largest it wasn’t neccesarily the best performing advertisement since most online advertisers develop their image ads to fit (…)

Calculating UPS Shipping Rate with PHP

by Mark Sanborn on November 27, 2007

It’s actually very easy to calculate shipping from UPS with PHP once you know how. But at first glance it seems like an impossible task to do.

Send email notifications with php

by Mark Sanborn on July 17, 2007

In order to send an email notification on your site via php you will probably need some sort of scheduled task program. This will execute the php script routinely. Since I tend to use open source software I used cron. Cron is found in Unix and Unix-like operating systems and is used to schedule commands (…)

Download files through authentication

by Mark Sanborn on July 6, 2007

I recently needed to implement a way for authenticated users to download files. Normally to host a file for download on a site you would need to provide the url to the download. www.yourdomain.com/restrictedfile.pdf.