PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1847
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Please, help with CURL equivalent Posted by alattar on 18 May 2004 at 12:04 AM
....

function UPSRequest($postdata,$type){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://wwwcie.ups.com/ups.app/xml/$type");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}

function ValidateUSAAddress($zip) {
$xml="<?xml version='1.0'?>";
$xml.="<AccessRequest>";
$xml.="<AccessLicenseNumber>".$this->LicenceNumber."</AccessLicenseNumber>";
$xml.="<UserId>".$this->UserID."</UserId><Password>".$this->Password."</Password></AccessRequest>";
$xml.="<?xml version='1.0'?><AddressValidationRequest xml:lang='en-US'><Request>";
$xml.="<TransactionReference><CustomerContext>Maryam Dennis-Customer Data</CustomerContext>";
$xml.="<XpciVersion>1.0001</XpciVersion></TransactionReference><RequestAction>AV</RequestAction></Request>";
$xml.="<Address>";
$xml.="<PostalCode>$zip</PostalCode></Address>";
$xml.="</AddressValidationRequest>";

$result=$this->UPSRequest($xml,"AV");
....



I used CURL-functions for UPS address validation.
But now I can't use this function in the script.
(It connected with the hosting features).
Can I use address validation via HTTPS UPS protocol
without CURL?

Can you write some rows of code as an example?
If it is not very complicated for you, of course.
Report
Re: Please, help with CURL equivalent Posted by rajiv_turkar on 18 May 2004 at 1:53 AM
hello there,
I have done UPS address validation ....You cannot use anything other than curl functions..you have to use curl functions only....I have seen your script seems correct ...I am not getting what problem you are facing..tell me in details so that i can help you
Regards
Report
Re: Please, help with CURL equivalent Posted by alattar on 18 May 2004 at 3:14 AM
: hello there,
: I have done UPS address validation ....You cannot use anything other than curl functions..you have to use curl functions only....I have seen your script seems correct ...I am not getting what problem you are facing..tell me in details so that i can help you
: Regards
:

Thank you very much for this explanation.
As a matter of fact, I can't use CURL library, because
it is not works into my host server. Well, I'm not
owner of this server. I can't to change this rules and
this is a reason of my experiments with without-curl scripts :)

I'll change my hosting place if there is no a good solution
for this problem, of cause. But it will be rather complicated...
Report
Re: Please, help with CURL equivalent Posted by rajiv_turkar on 18 May 2004 at 5:20 AM
okay you check whether curl library is included in your server or not
echo curl_version() ; will give the result whether curl is included or not...If curl fuctionality is not included in your server then tell them to install curl library..this will solve your problem...Let me know the things...bye



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.