简体   繁体   English

如何重定向PHP登录以将用户直接登录到ASPX站点?

[英]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>&nbsp; Login | &nbsp;<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.

相关问题 PHP:登录到.aspx网站并检索响应 - PHP: Log in to a .aspx site and retrieve response 如何使用PHP cURL登录到远程站点,然后重定向到该站点 - How can I log in to remote site with PHP cURL, then redirect to that site 如果用户直接尝试注销路由,我如何重定向到登录 - How can i redirect to login if user tries logout route directly php-登录时重定向用户 - php - redirect user on login 用户无需登录即可直接访问文件时,如何重定向登录页面 - How to redirect login page when the user to access the file directly without login 如何在登录后将一个opencart站点的用户重定向到另一个opencart站点? - How to redirect user of one opencart site to another opencart site after login? 登录后如何为重定向设置用户/管理员帐户? 的PHP - How to set user/admin accounts for a redirect after log in? PHP 如何格式化Login.php以重定向到用户的个人资料页面 - How to format Login.php to redirect to user's profile page 在PHP中登录后如何将用户重定向到特定链接 - how to redirect user to particular link after login in php PHP:如何检查用户是否已登录,否则重定向到登录页面 - PHP: How to check if user is already logged in and otherwise redirect to login page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM