想 模拟登录 自己学校的教务系统,失败了,请问大神

WBOY
Libérer: 2016-06-13 11:57:18
original
1032 Les gens l'ont consulté

想 模拟登录 自己学校的教务系统,失败了,请教大神
教务系统的网址:http://210.35.72.21:8888/edu/index.html (登录框在左侧)
用户名:1101002
密码:1101002s

最近在练习模拟登陆,于是我自己写了段模拟登陆教务系统,想试一下,但是一直不能登陆成功。所以想请教一下大神,问题出在哪里呢?

先谢了!

<br /><head><br /><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br /></head><br /><br /><body><br /><br /><?php  <br /><br />$cookie_file = tempnam('./temp','cookie');<br />$login_url = 'http://210.35.72.21:8888/edu/student/login.do?messageflag=true';<br />$post_fields  = 'username=1101002&password=1101002s';<br /><br />//登录并获取cookie<br />$ch = curl_init($login_url);<br />curl_setopt($ch, CURLOPT_HEADER, 0);<br />curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<br />curl_setopt($ch, CURLOPT_POST, 1);<br />curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);<br />curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);<br />echo $text = curl_exec($ch);<br />curl_close($ch);<br /><br />echo '<hr/>';<br /><br />//利用cookie加载一个页面<br />$url = 'http://210.35.72.21:8888/edu/student/historySchedule.do';<br />$ch = curl_init($url);<br />curl_setopt($ch, CURLOPT_HEADER, 0);<br />curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<br />curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);<br />echo $text = curl_exec($ch);<br />curl_close($ch);<br /><br />?><br /><br /></body><br />
Copier après la connexion

------解决方案--------------------
header里面是不是还需要传递其他参数。
mark一下,回去我去测试一把
------解决方案--------------------
1、登录“选课中心”主页,输入学号和密码,点击顶端“选课退课”菜单。 
显然你没有登录
------解决方案--------------------
你确定只有用户名密码两个参数?学生,老师这个参数呢?
你要登陆一次抓包看看,可以用firebug

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!