dongwu8064 2019-05-03 06:39
浏览 51

如何在网上购物网站上显示“产品描述”?

I try to show the product description in the online shopping. But it show me error, other product details can show in the oline shopping.

Below is my coding:

$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
$product_id = $row['product_id'];
$product_sku = $row['sku'];
$product_name = $row['prdNm'];
$product_price = $row['product_price'];
$product_category_name = $row['category_name'];
$product_weight = $row['weight'];
$product_image = $row['image'];
// $product_description = $row['description'];//
$product_price = $row['price'];
$product_shipment_type = $row['shipment_type'];
$product_warranty = $row['warranty'];
$product_short_description = $row['short_description'];

}

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.11street.my/rest/prodservices/product",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<?xml version=\"1.0\" encoding=\"UTF-8\" 
standalone=\"yes\"?>
<Product>
<selMthdCd>01</selMthdCd>
<dispCtgrNo>4932</dispCtgrNo>
<prdTypCd>01</prdTypCd>
<prdNm>$product_name</prdNm>
<prdStatCd>01</prdStatCd>
<prdWght>$product_weight</prdWght>
<minorSelCnYn>Y</minorSelCnYn>
<prdImage01>$product_image</prdImage01>
//<htmlDetail>$product_description</htmlDetail>//
<advrtStmt>9789792771251</advrtStmt>
<sellerPrdCd>815210</sellerPrdCd>
<selTermUseYn>N</selTermUseYn>
<selPrc>$product_price</selPrc>
<prdSelQty>9999</prdSelQty>
<cuponcheck>Y</cuponcheck>
<dscAmtPercnt>25</dscAmtPercnt>
<cupnDscMthdCd>01</cupnDscMthdCd>
<cupnIssStartDy>13/08/2014</cupnIssStartDy>
<cupnIssEndDy>20/08/2014</cupnIssEndDy>
<cupnUseLmtDyYn>Y</cupnUseLmtDyYn>
<pointYN>Y</pointYN>
<pointValue>100</pointValue>
<spplWyCd>02</spplWyCd>

The error is shown in below:

Error 400--Bad Request
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.1 400 Bad Request
The request could not be understood by the server due to malformed syntax. 
The client SHOULD NOT repeat the request without modifications.

I put the "//"symbol meaning is this "product description" code can't work. If work it will show me like below sample picture:enter image description here enter image description here Hope someone can help me solve this problem and let me know which parts appear error. Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 西门子S7-Graph,S7-300,梯形图
    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效
    • ¥15 悬赏!微信开发者工具报错,求帮改