Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.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 通过curl发布数据不起作用,但html很好_Php_Html_Curl - Fatal编程技术网

Php 通过curl发布数据不起作用,但html很好

Php 通过curl发布数据不起作用,但html很好,php,html,curl,Php,Html,Curl,我在html中: <form action="address" method="post" id="login_form"> <input type="text" class="text-input captcha-input" id="captcha_input" name="captcha"/> <input class="button" type="submit" id="submit" value="Sign In"&

我在html中:

<form action="address" method="post" id="login_form">
    <input type="text" class="text-input captcha-input" id="captcha_input" name="captcha"/>            
    <input class="button" type="submit" id="submit" value="Sign In">
</form>
不要张贴验证码!
请帮帮我,为什么你认为它没有发布验证码?你有什么错误吗?在
curl\u exec($ch)
do
var\u dump(curl\u getinfo($ch))之后并发布结果我发送“captcha=DAWDWAD&user=11&pass=22”错误显示:user OK,pass OK,但captcha未设置!在html中工作很好。返回结果JSON格式。两篇文章的结果:数组(20){[“url”]=>string(46)“siteAddressUrl”[“内容类型”]=>string(9)“文本/html”[“http代码”]=>int(200)[“标题大小”]=>int(635)[“请求大小”]=>int(207)[“文件时间”]=>int(-1)[“ssl验证结果”]=>int(0)[“重定向计数”=>int(0)=>(0)[“总时间”]=>float(1.06)[“名称查找时间”]=>float(0)[“连接时间”]=>float(0.015)[“预传输时间”]=>float(0.015)[“大小上传”]=>float(252)[“大小下载”]=>float(111)[“速度下载”=>float(104)[“速度上传”=>float(237)[“下载内容长度”]>float(111)[“上传内容长度”]=>float(252)[“开始传输时间”]=>float(0.686)[“重定向时间”]=>float(0)}
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, 'captcha=dawdewad');
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
echo $response = curl_exec( $ch );
curl_close($ch);