HTTPS (UPS Rates & Service Selection XML Tool)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
silk
Forum Newbie
Posts: 4
Joined: Mon Jul 29, 2002 5:51 pm
Location: Buzau, Romania

HTTPS (UPS Rates & Service Selection XML Tool)

Post by silk »

I want to implement a rate quote system for a PHP e-mall and I decided to use UPS's service.
The problem is they only accept secure connections to this server: https://www.ups.com/ups.app/xml/Rate, on port 443.
Is there any way I can make this work? (I've heared fsockopen doesn't support https://).
If you can find a way to succesfully connect to this server, please let me know. Oh, don't type the address in the browser - it will display an acknoledgement from UPS, but that's not what I need :wink:
Thanks :cry:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

fopen-manual
As of PHP 4.3.0, if you have compiled in support for OpenSSL, you may use "https://" to open an HTTP connection over SSL.

Note that the file pointer allows you to retrieve only the body of the response; to retrieve the HTTP response header you need to be using PHP 4.0.5 or later; The headers will be stored in the $http_response_header variable. As of PHP 4.3.0, the header information can be retrieved using the file_get_wrapper_data().
so you may want to try out the announced "Alpha 2 of PHP w/ the Zend Engine 2" as tar.gz or windows binary
silk
Forum Newbie
Posts: 4
Joined: Mon Jul 29, 2002 5:51 pm
Location: Buzau, Romania

Thanks

Post by silk »

Thanks, I'll try
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

The other easy way is to use the CURL library, which should handle more for you than fsockopen, but it may need SSL compiled in too (i think so)
silk
Forum Newbie
Posts: 4
Joined: Mon Jul 29, 2002 5:51 pm
Location: Buzau, Romania

cURL - OK

Post by silk »

cURL seems to work, but there's a big problem: are those constants defined anywhere?
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

yeah, you can just use them like in the example; they're defined in the C code for the Curl functions.
silk
Forum Newbie
Posts: 4
Joined: Mon Jul 29, 2002 5:51 pm
Location: Buzau, Romania

Yeah!

Post by silk »

Got it to work!!!
Thanks, guys
chadpry
Forum Newbie
Posts: 2
Joined: Fri Jun 13, 2003 2:18 pm

any examples

Post by chadpry »

any examples of some functioning code?
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

Take a look at these two threads
viewtopic.php?t=7148
viewtopic.php?t=9652
Post Reply