curl_setopt ($ch, Curlopt_postfields, $postfield); Set the string for post submission
1. Where is the curlopt_postfields stored in the header of HTTP or not?
2. What is the difference between the Post method of form form in Web page?
I do Delphi, and then the Idhttp control simulates the post of the Web page, but it seems a little different from PHP.
$postfield here only to see that there is a specified value, do not see the specified name attribute hey.
Reply to discussion (solution)
$postfield is a string that connects all of the form's name and value to & with key-value pairs.
According to the HTTP protocol, it does not belong to the header, but to the body (which should be separated from the header part \r\n\r\n)
$postfield is a string that connects all of the form's name and value to & with key-value pairs.
According to the HTTP protocol, it does not belong to the header, but the body (and the header part should have \r\n\r\n separated) The Post method is separated by a newline? If you do not specify his name, only one value is submitted what is the result?
The legal format should be similar to the ' Para1=val1¶2=val2& ... ' or use a field name as the key value, and the field data as the value of the array
You only pass value, then the target page will not be able to get the value you submitted.
No matter what the way, commit is to send a string, the General post is done by the browser
Curl just simulates post, just organizes some parameters and sends them instead of the browser
You two Delphi month ranked first, should also have done socket bar, socket is the string in accordance with the HTTP specification splicing up send?
I said it's a key-value pair, and it's got to be name.
name=abcdefg&password=123456 ...
Only value, the result is that the server can not find the required variables?
No matter what the way, commit is to send a string, the General post is done by the browser
Curl just simulates post, just organizes some parameters and sends them instead of the browser
You two Delphi month ranked first, should also have done socket bar, socket is the string in accordance with the HTTP specification splicing up send?
I said it's a key-value pair, and it's got to be name.
name=abcdefg&password=123456 ...
Only value, the result is that the server can not find the required variables? Thank you two bit, the problem has been solved!