【发布时间】:2015-05-07 23:21:43
【问题描述】:
我想在构建它之后发送一个 url。这是到目前为止的代码。
$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;
如果我用 header(location) 来做,那很好,但我认为这不是解决这个问题的方法。
【问题讨论】:
-
使用 curl 作为替代
-
我认为
$producten++在这里不正确