php - CURL POSTFIELD pass value in id or name? -


Now I write a simple login using curl to get information for optimization login from one site.

  $ url2 = "https://192.168.1.4/j_security_check"; $ PostData = "user = ABC and password = 123"; Curl_setopt ($ curl, CURLOPT_POST, 1); Curl_setopt ($ curl, CURLOPT_POSTFIELDS, $ postdata);   

I want to use the above code to pass the data on the j_security_check page.

The problem that I want to ask is ... when data goes through another page, name of this ID or such input type? (Text box field) ??

In this case, both 'user' and 'password' are textbox IDs, the name of the textbox is 'j_user' and 'j_password'. Besides, I have tried to pass both IDs and names, but these two do not succeed and fail me in login. I have ensured that the login name and password are both correct.

The login name and password have been passed to my approach authentication page (j_security_check) and after this it will confirm the login and password of the sign automatically,

In my viewpoint or idea Is it a mistake because I'm really new to curls?

Thanks a lot!

The name of the text box field (not the id) that should identify the posted value.

Comments