I now write a simple login by using curl to grab information for customization login from a site.
$url2="https://192.168.1.4/j_security_check";
$PostData = "user=abc&password=123";
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $PostData);
I would like to use the above code for pass the data to j_security_check page.
The problem I want to ask is…when the data pass to other page, it will pass by id or the name of such input type? (textbox field) ??
In this case, ‘user’ and ‘password’ are both textbox id. The name of textbox is ‘j_user’ and ‘j_password’.
In addition, I have tried to pass both id and name, but both are not success and return me fail in login. I ensured that login name and password are both correct.
My approach is pass the login name and password to the authentication page (j_security_check) and after that it will auto confirm the login name and password then logged in.
Are there any mistake in my approach or consideration since i am really new in curl?
Thanks everybody so much!!
The textbox field’s name (not id) is what should identify the value posted.