[英]How to Redirect PHP login to log user Directly into ASPX site?
Two different sites one PHP and the other ASPX. 两个不同的站点,一个是PHP,另一个是ASPX。 Problem is on the PHP site the login takes the user to our login page - it doesn't directly log the user into the password protected area.
问题是在PHP网站上,登录会将用户带到我们的登录页面-它不会直接将用户登录到密码保护的区域。 We want to user to login directly into our site from the Clients site.
我们希望用户直接从客户站点登录到我们的站点。
Our regular login: 我们的常规登录:
<form id="autolog" action="https://www.website.com/AutoLogin.aspx" method="get" name="autolog">
and <img onclick=" submitBtn();" src="img/btnSubmit.gif" alt="Submit" height="23" width="73" />
和
<img onclick=" submitBtn();" src="img/btnSubmit.gif" alt="Submit" height="23" width="73" />
<img onclick=" submitBtn();" src="img/btnSubmit.gif" alt="Submit" height="23" width="73" />
(and login code -see below) works on HTML sites (working as in user enters login and password and is taken directly into the password protected area. <img onclick=" submitBtn();" src="img/btnSubmit.gif" alt="Submit" height="23" width="73" />
(以及登录代码-参见下文)在HTML网站上有效(与用户输入登录名和密码一样,因此被采取直接进入密码保护区。
However when I put the Autologin.aspx in menu.php and the accompanying JavaScript into javascript folder the user enters name&password and is taken to our login page :( - and is not logged directly into our site. And just noticed that clicking on the login button opens our aspx login page which means the dropped in code has no effect of recognizing the user/pass. It's just a dog & pony show with no javascript engagement. 但是,当我将Autologin.aspx放入menu.php并将随附的JavaScript放入javascript文件夹时,用户输入名称和密码并进入我们的登录页面:(--并没有直接登录到我们的网站。只是注意到单击登录名按钮打开我们的aspx登录页面,这意味着放置的代码没有识别用户名/通行证的效果,这只是狗和小马的表演,没有javascript参与。
How to get the PHP site to recognize the user/password and log directly into our aspx site? 如何使PHP网站识别用户名/密码并直接登录到我们的aspx网站?
Here is the original snippet of code from menu.php on the client site: 这是客户端站点上menu.php的原始代码片段:
>><?php
include("./login/database.php");
?>
<link href="/_stylesheets/menu.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript" src="/_includes/js/m.js"></script>
<form action="process.php" method="post" name="login">
<?
//var_dump($_SESSION['logged_in']);
if($session->logged_in){
print("<a href='process.php'> Logout </a> | <a href='/?sec=login&sub=myaccount'> My Account </a>");
}else{
?>
<span>Login in and submit work and check status online</span>
<span> |</span> USER <input type="text" name="user" class="medium" maxlength="30">
Password <input type="password" name="pass" id="pass" class="medium" maxlength="30"/>
<input type="hidden" name="sublogin" id="button" value="sublogin"/>
<input type="submit" name="login" id="button" value="LOGIN" class="inputbtn"/>
<? } ?>
Here is the modified code supposed to Log User Directly in: 以下是修改后的代码,可以直接登录用户:
<link href="/_stylesheets/menu.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/_includes/js/global.js"></script>
<script language="javascript" type="text/javascript" src="/_includes/js/m.js"></script>
<body onload="pageLoad();">
<form id="autolog" action="https://www.website.com/AutoLogin.aspx" method="get" name="autolog">
<?
//var_dump($_SESSION['logged_in']);
if($session->logged_in){
print("<a href='process.php'> Logout </a> | <a href='/?sec=login&sub=myaccount'> My Account </a>");
}else{
?>
<span> Login | <a href="https://www.website.com/default.aspx?psid=175&pstype=st&psonly=1&target=home">SIGN UP HERE</a></span>
<span> |</span> User <input type="text" name="user" class="medium" maxlength="30">
Password <input type="password" name="pass" id="pass" class="medium" maxlength="30"/>
<input type="hidden" name="sublogin" id="button" value="sublogin"/>
<input type="submit" name="login" id="button" value="LOGIN" class="inputbtn"/>
<span><a href="https://www.website.com/forgotpass.aspx?psid=175pstype=st&psonly=1&target=home">Forgot your password?</a></span>
<? } ?>
Where do I put - <img onclick=" submitBtn();" src="img/btnSubmit.gif" alt="Submit" height="23" width="73" />
我在哪里放置-
<img onclick=" submitBtn();" src="img/btnSubmit.gif" alt="Submit" height="23" width="73" />
<img onclick=" submitBtn();" src="img/btnSubmit.gif" alt="Submit" height="23" width="73" />
It is as simple as putting - submitBtn(); 就像把它一样简单-SubmitBtn(); -(activates the java) in the right spot?
-(激活Java)在正确的位置? Where does it go?
去哪儿了? I've tried it everywhere.
我到处都尝试过。 What am I missing?
我想念什么?
Found the answer weeks ago - my question was probably somewhat convoluted but here's the answer - : 几周前找到了答案-我的问题可能有点令人费解,但这是答案-:
Login | 登录| SIGN UP |
注册| User Password FORGOT PASSWORD?
用户密码忘记密码?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.