这种情况可以实施吗? [英] Can this scenario be implemented?

查看:79
本文介绍了这种情况可以实施吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想从我网站上的其他网站链接一个页面,但该页面将我发送到该网站的登录页面,这是可以理解的。如果我首先登录该网站从我的浏览器,然后尝试去那个页面网址,它工作正常。我可以通过在查询字符串中提供用户名和密码来绕过登录页面。所以这就是我想做的事情?



1-发送带有必要用户名和密码的登录页面请求。

2-重定向到所需页面而不显示登录后登录页面自动为您提供的页面。



如何操作?



问候

Hi All,
I want to link a page from another website on my website but that page is sending me to the login page of that website which is understandable.If I first login to that site from my browser and then try to go to that page url, it works fine. I can bypass the login page by providing username and password in the query string. So here is what I want to do ?

1- Send a request for the login page with the necessary username and password.
2- Redirect to the desired page without showing the page where login page automatically takes you after logging in.

How to do it ?

Regards

推荐答案

传递参数有两种方式:



1.get:

url就像:login.aspx?username = 1& pwd = 2





















2.post

url就像:http://www.codeproject.com/Questions/626428/

但你的表格会发布价值



< form action =login.aspxmethod =post>

< input type =textname =username />

< input type =textname =password/>

< input type =submitvalue =submit/> ;

< / form>



如果用户通过您的身份验证



Response.Redirect(index.aspx);



else



Response.Redirect(login.aspx);
pass parameters have two ways :

1.get :
url just like: login.aspx?username=1&pwd=2










2.post
url just like: http://www.codeproject.com/Questions/626428/
but your form will post values

<form action="login.aspx" method="post">
<input type="text" name="username" />
<input type="text" name="password" />
<input type="submit" value="submit" />
</form>

if the user pass your authentication

Response.Redirect("index.aspx");

else

Response.Redirect("login.aspx");


这篇关于这种情况可以实施吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆