UPS XML Rate PHP script
I did not think that this old php script is still interested by someone. Anyway, I received an inquiry today that my upsrate script’s result does not match with UPS homepage’s result.
Actually, they generate the same result if you provide the same option. Those options were not available to choose in the original upsrate script. I updated it today that you can try the script more easily.
Hi, you’ve saved me!!!!, this script will save me alot of work.
By the way I think you’ve got to check the Weigth field the legend seems to say that it’s for pounds,
but I think you actually send Kg, maybe you forgot to do the conversion from pounds to Kg when you did this
version of the script.
Anyway thanks a lot!!!!
Comment by Ricardo — October 25, 2007 @ 4:54 am
Hi, I’ve been customizing and testing your form, and I’ve found 2 miskates that have been driving me crazy
for a while, it’s to change the “Schipping To” adress. First you missed one equal symbol:
if($s_zip==” || $s_country==” || $t_zip==” || $t_country=” || $weight==”){
$error_msg=”please provide all information”;
“$t_country=”” you know you’re doing an asignation instead of a comparation.
You also misspelled the $t_country to check if it has been set.
You wrote
if ($t_coutnry == ” ) $t_country=’US’;
instead of
if ($t_country == ” ) $t_country=’US’;
I hope having halped you as you’ve helped me, and thanks again.
Comment by Ricardo — October 25, 2007 @ 5:42 am
Ricardo, Thank you for your feed back. I will update the tar file.
Comment by HanaDaddy — October 25, 2007 @ 8:23 am
I’m trying to get this to work with my web page. I tryied running it as is (execept for my passwords) at it seems to lock up after I submit the request for a price. I use godaddy lunix servers and I’m fairly sure that they have _curl enabled on all their lunix servers. Is their somthing else I need to change to make this work?
Comment by Jeff B — November 1, 2007 @ 5:21 pm
You can test if curl module is compile in by using “phpinfo()” function. Please take a look at the PHP /Webserver log for any clue. Also you may want to test with console ‘curl’ command first.
Comment by HanaDaddy — November 1, 2007 @ 6:39 pm
curl
CURL support enabled
CURL Information libcurl/7.10.6 OpenSSL/0.9.7a ipv6 zlib/1.2.3
The phpinfo() gave me the above info about CURL. So I guess that isn’t the problem. If I had the worng password or key would that cause the problem? That make you just through hoops a ups hand kive you developer keys/ developer user name, xml keys. If i’m using the wrong username or key would that cause it to hang? Thanks for any insite.
Comment by Jeff B — November 1, 2007 @ 7:51 pm
Test with console ‘curl’ command that if you can connect to the ups server.
> /usr/bin/curl -k https://www.ups.com/ups.app/xml/Rate
At least you can check if you can connect to the ups.com site from you hosting server.
Comment by HanaDaddy — November 2, 2007 @ 5:50 pm
HanaDaddy, You script works great. My problem was the godaddy servers blocking any type of 3rd party web site (ie. UPS). godaddy wants me to upgrade to the dedicated or virtual dedicated servers for $50 dollars a month (haha). I switch servers to someone else and all is well! thanks.
Comment by Jeff B — November 5, 2007 @ 12:15 pm
I must say that this script is a life saver in every possible way. I have gone thru so many over the last few months. The problem I ran into was my server does not handle asp. Just about every good working cal script out there is based on asp.
Again, thank you for your great work.
Comment by Robert — April 11, 2008 @ 3:04 pm
Quick question. If possible, could you tell me how to add a quantity selection?
Comment by Robert — April 11, 2008 @ 3:54 pm
Thanks for this wonderful class! Even though it may be “old” it still works a charm! Helped me quickly and easily estimate rate calculations into a project of mine.
Cheers!
Comment by Fred — June 30, 2008 @ 3:17 pm