Please, help with CURL equivalent - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Please, help with CURL equivalent

alattaralattar Posts: 2Member
....

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.="";
$xml.="".$this->LicenceNumber."";
$xml.="".$this->UserID."".$this->Password."";
$xml.="<?xml version='1.0'?>";
$xml.="Maryam Dennis-Customer Data";
$xml.="1.0001AV";
$xml.="
";
$xml.="$zip
";
$xml.="";

$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.

Comments

  • rajiv_turkarrajiv_turkar Posts: 32Member
    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
  • alattaralattar Posts: 2Member
    : 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...
  • rajiv_turkarrajiv_turkar Posts: 32Member
    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
Sign In or Register to comment.