POST登录方式的问题
时间:2011-12-10
来源:互联网
亲们,我的asp表单是这样的:
<form method="post" action="checkuser.asp">
学号<input type=text name="username" value=admin>
密码<input type=password name="pwd" value=admin>
学生<input type=radio name="tp" value="学生" checked>
<input name="method" value="login">
<input type=submit>
</form>
我保存为html点击提交时可以登录
但是
MFC里登录时,我用如下方法
pHttpConnection = Session.GetHttpConnection("我的IP地址");
CString headers = _T("Content-Type: application/x-www-form-urlencoded");
CString data="?username=admin&pwd=admin&tp=学生&method=login";
pHTTP = pHttpConnection->OpenRequest("POST", "/checkuser.asp");
pHTTP->SendRequest(headers,headers.GetLength(),(LPVOID)(LPCTSTR)data,data.GetLength());
总是无法登录。
这是为什么呢?
谢谢。
<form method="post" action="checkuser.asp">
学号<input type=text name="username" value=admin>
密码<input type=password name="pwd" value=admin>
学生<input type=radio name="tp" value="学生" checked>
<input name="method" value="login">
<input type=submit>
</form>
我保存为html点击提交时可以登录
但是
MFC里登录时,我用如下方法
pHttpConnection = Session.GetHttpConnection("我的IP地址");
CString headers = _T("Content-Type: application/x-www-form-urlencoded");
CString data="?username=admin&pwd=admin&tp=学生&method=login";
pHTTP = pHttpConnection->OpenRequest("POST", "/checkuser.asp");
pHTTP->SendRequest(headers,headers.GetLength(),(LPVOID)(LPCTSTR)data,data.GetLength());
总是无法登录。
这是为什么呢?
谢谢。
作者: Danny_Share 发布时间: 2011-12-10
CString data="?username=admin&pwd=admin&tp=学生&method=login";
去掉第一个?,并且对“学生”进行URL_encode
CString data="username=admin&pwd=admin&tp="+URL_encode
("学生")+"&method=login";
去掉第一个?,并且对“学生”进行URL_encode
CString data="username=admin&pwd=admin&tp="+URL_encode
("学生")+"&method=login";
作者: ok1234567 发布时间: 2011-12-11
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28