Php Curl Post表格数据注册

时间:2017-09-22 02:30:24

标签: php http curl post

我正在进行自动注册。并使用CURLOPT_POSTFIELDS发布表单数据。 我有4个数据要发布。但响应总是说3.和4.“这个字段是必需的。”因此,如果用户名首先确定已发布,但如果是3.不发布。

示例:

$form_values = http_build_query( array('username' => $this->username, 'email'=> $this->email, 'password'=> $this->pass,  'first_name' => $this->name) );

发布用户名和电子邮件。给出关于密码和名字的错误。

$form_values = http_build_query( array('email'=> $this->email, 'password'=> $this->pass,  'username' => $this->username, 'first_name' => $this->name) );

发布电子邮件并仅通过。

怎么可能。我已经尝试编写后期数据手册了。

1 个答案:

答案 0 :(得分:0)

可能的尝试是

  1. curl_setopt($ curlobj,CURLOPT_URL,'http://localhost/mytest.php');
  2. in mytest.php var_dump($ _ POST);
  3. 检查帖子是否正确,可能问题是目标表格
  4. 将目标表单的帖子网址修改为http://localhost/mytest.php firebug或chrome检查帖子