I want to simulate logon to my school's educational administration system. if I fail to log on to my school's educational administration system, visit 210.35.72.21: 8888eduindex.html & nbsp; (on the left side of the logon box) user name: 1101002 password: 1101002s recently practiced simulated login, so I wrote a simulated login section to log on to the educational administration system. I want to give it a try, but I have never been able to log on successfully. So I 'd like to ask a question. what is the problem? Thank you! & Lt; h I want to simulate logon to my school's educational administration system, but I failed.
Educational Administration System website: http: // 210.35.72.21: 8888/edu/index.html (the logon box is on the left)
Username: 1101002
Password: 1101002 s
I have been practicing simulated logon recently, so I wrote a paragraph to simulate logon to the educational administration system. I want to give it a try, but I have never been able to log on successfully. So I 'd like to ask a question. what is the problem?
Thank you!
$ Cookie_file = tempnam ('./temp', 'cooker ');
$ Login_url = 'http: // 210.35.72.21: 8888/edu/student/login. do? Messageflag = true ';
$ Post_fields = 'username = 1101002 & password = 1101002s ';
// Log on and obtain the cookie
$ Ch = curl_init ($ login_url );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_POST, 1 );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ post_fields );
Curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ cookie_file );
Echo $ text = curl_exec ($ ch );
Curl_close ($ ch );
Echo'
';
// Load a page using cookies
$ Url = 'http: // 210.35.72.21: 8888/edu/student/historySchedule. do ';
$ Ch = curl_init ($ url );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_COOKIEFILE, $ cookie_file );
Echo $ text = curl_exec ($ ch );
Curl_close ($ ch );
?>
------ Solution --------------------
Whether other parameters need to be passed in the header.
Mark it. go back and I'll test it.
------ Solution --------------------
1. log on to the "course selection center" homepage, enter the student ID and password, and click the "course selection and exit" menu at the top.
Apparently you are not logged on
------ Solution --------------------
Are you sure you only have two parameters: user name and password? Student, what about the instructor parameter?
You need to log on to the system to capture packets. you can use firebug.