Home > Backend Development > PHP Tutorial > curl post异常,求解

curl post异常,求解

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:45:24
Original
1556 people have browsed it

curl post错误,求解

$url="http://dct.dhl.com/input.jsp?langId=cn&originCCId=CN";<br />$post_data="orgCtry=CHINA, PEOPLES REPUBLIC (CN)&orgZip=510011&orgCity=GUANGZHOU&dstCtry=HONG KONG (HK)&dstCity=HONG KONG&declValCur=USD&weight=0.2&shipping_options=Submit";<br />$ch=curl_init();<br />echo phpinfo();<br />curl_setopt($ch,CURLOPT_URL,$url);<br />curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);<br />curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);<br />curl_setopt($ch,CURLOPT_HEADER,0);<br />curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3'); <br />curl_setopt($ch,CURLOPT_POST,1);<br />curl_setopt($ch,CURLOPT_POSTFIELDS,$post_data);<br />//ob_start();<br />$output=curl_exec($ch);<br />curl_close($ch);<br />print_r($output);<br />//ob_end_flush();
Copy after login

不知道为什么post不成功啊,求救

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template