本帖最后由 xeqtrl982 于 2011-04-13 17:50:32 编辑

解决方案 »

  1.   

    file_get_contents('https://www.orderyourstoday.com/TestEnvironment/orderinputapi.asp?username=apitest&password=testaccount&[email protected]&firstName=test&lastName=test&address=123+Test+St&city=Test+City&state=UT&postal=84001&country=US&confOnOff=E&preferredShipMethod=USPS1CL&sku01=test&qty01=1')
      

  2.   

    按照1楼的方法,果然可行。
    可是返回值是个
    database email is: [email protected] email is: [email protected] is [email protected] State=UT. databaseState=UT. PostedZip=84001. databaseZip=84001Existing customer. Email, state and zip match, updating customer via matched email address.
    &result=0&orderid=121000702怎么能提取result和orderid
      

  3.   

    浏览器打开不是GET么,为什么要模拟POST?数据 $ch = curl_init();
       
            curl_setopt($ch, CURLOPT_URL, 'https://www.orderyourstoday.com/TestEnvironment/orderinputapi.asp?username=apitest&password=testaccount&[email protected]&firstName=test&lastName=test&address=123+Test+St&city=Test+City&state=UT&postal=84001&country=US&confOnOff=E&preferredShipMethod=USPS1CL&sku01=test&qty01=1');
                curl_setopt($ch, CURLOPT_PORT , 443);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
            curl_setopt($ch, CURLOPT_TIMEOUT, 30);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        
            $response = curl_exec($ch); echo $response;
      

  4.   

    回楼上大哥,他的文档中写了
    如果用POST方式会更好
    我就用POST来做了
      

  5.   

    Input URL and query string (Note: GET is used here, however POST method is preferred)