Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 完成后发送url_Php_Url_Post_Get - Fatal编程技术网

Php 完成后发送url

Php 完成后发送url,php,url,post,get,Php,Url,Post,Get,我想在构建url后发送call。这是到目前为止的代码 $producten = ''; foreach ($orders as $product) { $producten .= "&articlecode=" . $product['productTitle'] . "&color=NAVY&size=" . $product['variantTitle'] . "&qty=" . $product['quantityOrdered']

我想在构建url后发送call。这是到目前为止的代码

   $producten = '';
   foreach ($orders as $product) {
       $producten .= "&articlecode=" . $product['productTitle'] . "&color=NAVY&size=" . $product['variantTitle'] . "&qty=" . $product['quantityOrdered'] . "&price=" . number_format($product['priceIncl'], 2) * 100;
}

    $url= file_get_contents('http://api.softwear.nl/scripts/foxisapi.dll/sww1.wreq1.mpx?sendorder&token=' . $swToken . '
                        &custnum=' . $custNum . '&email=' . $email . '&title=' . $gender . '&firstname=' . $firstname . '&middlename=' . $middlename . '&lastname=' . $lastname . '
                        &street=' . $addressBillingName . '&housenum=' . $addressBillingNumber . '&zipcode=' . $addressBillingZipcode . '&city=' . $addressBillingCity . '
                        &countrycode=' . $code . '&shipping=' . $shipmentTrim . '&discount=' . $discountTrim . '&refid=' . $referralId . $producten++); 

echo $url;

如果我用标题(位置)来做,这很好,但我认为这不是解决这个问题的方法。

我明白了。下面是有相同问题的人的代码

    /* cURL Resource */
$ch = curl_init();

/* Set URL */
curl_setopt($ch, CURLOPT_URL, 'http://api.softwear.nl/scripts/foxisapi.dll/sww1.wreq1.mpx?sendorder&token=' . $swToken . '
                        &custnum=' . $custNum . '&email=' . $email . '&title=' . $gender . '&firstname=' . $firstname . '&middlename=' . $middlename . '&lastname=' . $lastname . '
                        &street=' . $addressBillingName . '&housenum=' . $addressBillingNumber . '&zipcode=' . $addressBillingZipcode . '&city=' . $addressBillingCity . '
                        &countrycode=' . $code . '&shipping=' . $shipmentTrim . '&discount=' . $discountTrim . '&refid=' . $referralId . $producten++);

/* Tell cURL to return the output */
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

/* Tell cURL NOT to return the headers */
curl_setopt($ch, CURLOPT_HEADER, false);

/* Execute cURL, Return Data */
$data = curl_exec($ch);

/* Check HTTP Code */
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

/* Close cURL Resource */
curl_close($ch);

/* 200 Response! */
if ($status == 200) {

    /* Debug */
    var_dump($data);

} else {

    /* Debug */
    var_dump($data);
    var_dump($status);

}

使用curl作为替代方法我认为
$producten++
在这里不正确