2017-09-22 45 views
0

我正在進行自動註冊。並使用CURLOPT_POSTFIELDS發佈表單數據。 我有4個數據要發佈。但是迴應總是說3和4.「這個字段是必需的。」。因此,如果用戶名第一次確定發佈,但如果它是3.不發佈。Php捲曲發佈表單數據註冊

例子:

$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)); 

只發郵件並通過。

怎麼可能。我已經嘗試寫郵政數據手冊。

回答

0

一個可能的嘗試是

  1. curl_setopt($ curlobj,CURLOPT_URL, 'http://localhost/mytest.php');
  2. in mytest.php var_dump($ _ POST);
  3. 檢查後,如果它是正確的,也許問題是目標形式的目標形式的
  4. 定位後的URL http://localhost/mytest.php在 螢火或Chrome檢查後
+0

謝謝哥們。這是關於標題:內容長度。 – HasanDahsin