Well, here's a website where you can get the latitude an longitude (which i suspect you could easily translate into miles) of a specified zip code
http://www.census.gov/cgi-bin/gazetteer/
Now, getting all the zip codes in this database manually would be pretty tedious... The remedies I can think of are:
1) Write a script that checks all zip codes (00001 through 99999) and use a Regular Expression to extract the coordinates from the page when it comes back, then store these coordinates to your database.
2) Have your script check your database to see if you already have the info for the submitted zip code, and if not, do the same thing as in #1 above, only for that code. Eventually you would build up a pretty complete library of zip codes.
3) Find another way to get the zip codes. Writing the regular expression for this could be a little tricky.
Once you have the latitude and longitude for your two zip codes, you could subtract them to get the north-south difference and the east-west difference. Using those and the pythagorean theorem you could find the distance between the two points. Find a conversion factor for degrees (distance, lat. & long.) to miles and you're set
This could all be a little more work than you want to put into it though. It would be a cool webapp when you're done though. If you need / want more help, just let me know
