Using simulated login to capture the morning run data of the school system failed. ask the great god to study the simulated login of php recently and try to use the school's physical education system for practice, but it failed. Could you tell me what is wrong with my code?
[Some information]
Logon address: http: // 210.35.75.247: 8080/student/studentFrame. jsp
(User name: 1101001; password: 1101001; role: Student)
Check the morning run address: http: // 210.35.75.247: 8080/student/queryCheckInfo. jsp
[The code is as follows]
[Thank you for your first posting !]
Reply to discussion (solution)
There is no major problem with your code. the result returned by curl_exec () is that you did not receive the result and no output, so it is blank.
I tried it just now. the login was successful.
$ Name, 'passwd' => $ pw,); $ ch = curl_init (); curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, CURLOPT_HEADER, 0); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ ch, CURLOPT_POST, 1); curl_setopt ($ ch, CURLOPT_POSTFIELDS, http_build_query ($ params )); $ con = curl_exec ($ ch); curl_close ($ ch); echo preg_replace ('/ Back to the upstairs wandre_wind:
Thank you! But what I want to capture is the morning run data, so I want to save the login cookie through simulated login, and then go to this address (http: // 210.35.75.247: 8080/student/queryCheckInfo. jsp) captures the number of morning run times. I don't know why the logon error is displayed. could you please help me? Trouble! Thank you!
There is no major problem with your code. the result returned by curl_exec () is that you did not receive the result and no output, so it is blank.
I tried it just now. the login was successful.
$ Name, 'passwd' => $ pw,); $ ch = curl_init (); curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, CURLOPT_HEADER, 0); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ ch, CURLOPT_POST, 1); curl_setopt ($ ch, CURLOPT_POSTFIELDS, http_build_query ($ params )); $ con = curl_exec ($ ch); curl_close ($ ch); echo preg_replace ('/ I'm just a Cainiao.
First declare several terms...
Framework Page student/studentFrame. jsp form submission action address
Student/studentInfo. jsp is the src automatically loaded by iframe on the Framework page.
Morning run result student/queryCheckInfo. jsp
I used firebug to track the login process and found that the student information loaded by iframe on the Framework Page was followed by parameters? Username =... & passwd =..., guess the real login process should be on the student information page. I saved the failed login page without echo in the file. The html on the Framework page is almost the same as that on the login success, but I jumped to js with an additional section. The JSESSIONID on the student information page is successfully logged in. it is different from the framework page. Egg management system
$name, 'passwd' => $pw,);$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url1 . '?' . http_build_query($params));curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$con = curl_exec($ch);preg_match('/Set-Cookie: (.*);/Us', $con, $match);$cookie = $match[1];curl_setopt($ch, CURLOPT_URL, $url2);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_COOKIE, $cookie);$con = curl_exec($ch);curl_close($ch);echo $con; Ah, it turns out that http: // 210.35.75.247: 8080/student/studentInfo. jsp is playing a strange role. Successful! Thank you !!
I'm just a Cainiao.
First declare several terms...
Framework Page student/studentFrame. jsp form submission action address
Student/studentInfo. jsp is the src automatically loaded by iframe on the Framework page.
Morning run result student/queryCheckInfo. jsp
I used firebug to track the login process and found that the student information loaded by iframe on the Framework Page was followed by parameters? Username =... & passwd =..., guess the real login process should be on the student information page. I saved the failed login page without echo in the file. The html on the Framework page is almost the same as that on the login success, but I jumped to js with an additional section. The JSESSIONID on the student information page is successfully logged in. it is different from the framework page. Egg management system
$name, 'passwd' => $pw,);$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url1 . '?' . http_build_query($params));curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$con = curl_exec($ch);preg_match('/Set-Cookie: (.*);/Us', $con, $match);$cookie = $match[1];curl_setopt($ch, CURLOPT_URL, $url2);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_COOKIE, $cookie);$con = curl_exec($ch);curl_close($ch);echo $con; It seems that points can be given.
In addition, it seems that you want to close the post.
Haha, sorry. I am not familiar with the first post ~ Thank you!
It seems that points can be given.
In addition, it seems that you want to close the post.