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!!!!
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.
Ricardo, Thank you for your feed back. I will update the tar file.
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?
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.
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.
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.
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.
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.
Quick question. If possible, could you tell me how to add a quantity selection?
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!
Thank for sharing.
I’ve research on PHP + XML UPS Online Tools for whole day.
It seems this is the correct package that I really needs. Many Thanks.
this is absolutely great stuff. great work, i commend you! at first i could not get this to work and was about ready to give up but i looked through the .pdf document UPS provides for the rate and service selector. there is no php in that sdk but i did pick up on something interesting and decided to give it a try. i noticed the example url they say to to try for curl is: https://wwwcie.ups.com/ups.app/xml/Rate. in the code that is provided above, the url was identical except it was http://www.ups….. . once i changed it to wwcie then POOF! it worked! not sure why but i thought i would post this on here in case it is an issue for someone else.
Thank you nate, but when I tried both www and wwwcie worked. Hmm…
i know i was more shocked than the next person that it worked. oh well! probably some configuration on our server or something. lucky break, i guess 🙂
Right out of the box your software worked 1st time!! I have a web store that is written in perl and I was wondering how much of a hassle would it be to get you output into perl?
Thank you for making your program available to all.
Walter
Is there a way to get the transit days for ground?
bob, i believe all ups ground shipments are guaranteed for 5 days but it is a very loose guarantee at that. if you wanted to use the 5 days as an expected transit time i think you’re going to have to make that calculation in php before it is outputted into html.
Awesome script saved me so much core scripting, 2009 and still as use full as 2007
Thanks a lot
It is very helpful for php developer and easy way to integrate with UPS.
I searched a lot but find it better than other.
Thanks again
Old script or not, this one works very well!
The only thing I haven’t figured out, and I don’t know if it’s even possible, but is there a way the script can return results only on specific shipping methods of my choice? I only offer a few different options since the product I sell doesn’t warrant any kind of expedited overnight kind of shipping. I tried eliminating some of the choices in the ups_service array, but the pricing still shows up.
I appreciate any help.
Thanks
Hello thank you for your comment.
Actually I am not sure how to provide the multiple service types in the request even though you can do it if you want just one service type.
If you just want ‘UPS Ground’ , use ’03’ for the service type (The first argument of the rate member function)
You can also filter out the XML results if you want to show more than one service types.
Hi,
thanks a lot for the code. You are very generous. By the way, i found out that rate for UPS Express Saver is not the same at on UPS website. Can you find out why? Thank you so much
sorry i forgot the UPS calculator link : https://wwwapps.ups.com/ctc/request