简体   繁体   中英

How to Redirect PHP login to log user Directly into ASPX site?

Two different sites one PHP and the other 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. 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" /> (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.

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.

How to get the PHP site to recognize the user/password and log directly into our aspx site?

Here is the original snippet of code from menu.php on the client site:

>><?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" />

It is as simple as putting - submitBtn(); -(activates the java) in the right spot? 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM