Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting unexpected T_DNUMBER, but why??

    Hi all,

    This is my first shot at using PHP and cURL. I am getting the error "unexpected T_DNUMBER" on line 4 and I don't know why.

    PHP Code:
    <?php
        $ch 
    curl_init();
        
    curl_setopt($chCURLOPT_URL"https://www.example.com/gateway_cvn/xmlpayment.asp");
        
    curl_setopt($chCURLOPT_POST"<?xml version="1.0" encoding="ISO-8859-1"?><root><CustomerID>1</CustomerID></root>");
        
    curl_exec($ch);
        
    curl_close($ch);
    ?>
    Does anyone know why?

  • #2
    Regular Coder
    Join Date
    Jul 2010
    Location
    Oregon City
    Posts
    280
    Thanks
    5
    Thanked 50 Times in 49 Posts
    PHP Code:
        curl_setopt($ch, CURLOPT_POST, "<?xml version="1.0" encoding="ISO-8859-1"?><root><CustomerID>1</CustomerID></root>");
    should be

    PHP Code:
        curl_setopt($ch, CURLOPT_POST, "<?xml version='1.0' encoding='ISO-8859-1' ?><root><CustomerID>1</CustomerID></root>");

  • #3
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah I thought it a bit strange to. I tried with a space, but it still doesn't work. I was going off what w3schools.com outlined.

    I just removed it. I didn't need it anyway.

  • #4
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For some reason its not letting me thank you via the green button, so thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •