SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Auto Submit for Login Not Working Right

    Okay, first I will explain why we are doing it the way that we are. I work at a office supply store, and currently we are in the transition of moving our online customers from one system to another system. These systems are ecommerce scripts that we do not have access to the coding for them. The pages themselves are hosted at the the manufacturer's site.

    What we want to do is have one login for both sites, I have already got a way to determine where the user needs to go. So what happens is that the user goes to our portal page (that we have access to) and fills out the login. The database I setup checks if the user is on the new system (ECI) or not. If they are on the old system then it brings them to one page that fills out the login form and auto submits to login to the old system on the other server. If they are to go to the new system then they are sent to a different page that fills out a form and auto submits to the new system.

    However the auto submit script (so they don't have to click login twice) prevents ECI from automatically logging them in. It instead transfers over the username and puts it into ECI's login form, but does not bring over the password, nor does it attempt to submit ECI's form. If I take out the auto submit part and click login myself then it does automatically log into ECI perfectly fine.

    I am using the following for the auto submit:
    <body onLoad="document.aspnetForm.submit()" >

    And I have pulled all the code for ECI that is necessary for the login form (which is more then what it should be) and have stuck it in my script. It works fine if I don't have the auto submit code in there, if I put it in then it doesn't work. I will try to explain my file structure below.

    Portal Page --> User Logs into site from portal page --> They are sent to "send.php" where the script checks a custom built database to see where the username needs to be sent to. This page also saves the login form details in a session --> They need to go to ECI so are then sent to eci.php --> eci.php fills in the form on this page from the session and auto submits after page load --> they are sent to ECI where they are fully logged in (or atleast this is how it needs to be, isntead at this step they are brought to the login form on ECI where only the username is already filled out.)

    Any ideas? I am not able to post a link unfortunately. I will try to post any code I can in the next post.

    Thank you for taking the time to read all of this and thanks ahead of time for any help!

  2. #2
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what the code on eci.php currently looks like. I have been messing with it to try to get it to work, this code includes the use of the auto submit.

    HTML Code:
    <?php
    session_start();
    header("Cache-control: private"); // IE 6 Fix.
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Complete Office</title>
    <style type="text/css">
    <!--
    body {
    font-family: Arial, sans-serif;
    	color: #083A75;
    }
    .style2 {
    	font-size: 24px;
    	font-family: Geneva, Arial, Helvetica, sans-serif;
    	color: #083A75;
    }
    .style3 {
    	font-size: 16px;
    	font-family: Geneva, Arial, Helvetica, sans-serif;
    	color: #083A75;
    	font-weight: bold;
    }
    -->
    </style>
    
    </head>
    
    <!-- office supplies and computer products are our business -->
    <!-- -->
    <body onLoad="document.aspnetForm.submit()" >
    <center>
    <h1 class="style2">Logging in, please wait...</h1><br />
    <br />
    <img src="http://www.complete-office.com/images/radial.gif" />
    </center>
    
    <!--div style="height:1px; overflow:hidden;"-->
    
    <form name="aspnetForm" method="post" action="https://www.ecinteractive.com/6314/ECILogin.aspx" id="aspnetForm" style="margin:10px 0px">
    <div>
    <input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
    
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTQzNzM1MTE2NA9kFgJmD2QWAgIDD2QWAgIBD2QWFAIDD2QWAmYPZBYEZg9kFgYCAQ8PFgIeCEltYWdlVXJsBVZodHRwczovL2ltYWdlcy5lY2kyLmNvbS93ZWJpbWFnZXMvZjQ0ZTU5NTYtZGNlNC00ODQ0LTg2MGUtOTg4MDAwZGU4ZGMzL2Nvc2xvZ28tanBnLmpwZ2RkAgkPDxYCHgtOYXZpZ2F0ZVVybAVYaHR0cDovL2ltYWdlcy5lY2kyLmNvbS9lY0ludGVyYWN0aXZlX2VuZHVzZXJoZWxwL2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AkY3BoMSRtdjEPD2RmZAURY3RsMDAkSGVhZGVyMSRtdjEPD2RmZAURY3RsMDAkTEkxJG12TG9naW4PD2RmZEloB8YWzov3Apx0UNS0jn0PPM0+" />
    </div>
    <!-- END ECinteractive Script Code -->
    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.aspnetForm;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
    </script>
    
    <script src="https://www.ecinteractive.com/6314/WebResource.axd?d=aDyzUtBk1z7Y7rxd6RNlCw2&amp;t=633357825316303369" type="text/javascript"></script>
    
    
    <script src="https://www.ecinteractive.com/6314/WebResource.axd?d=3W8DMbeSjJMl1xwiWjZ7IC_1m_MmieYaB3bHTtvnPUTexZTi46gJGBDmI35I6low0&amp;t=633613805400000000" type="text/javascript"></script>
    
    <script src="https://www.ecinteractive.com/6314/WebResource.axd?d=o2bPRB1qdBfn4ELu708khNxrBmKDrSHd5_2Hzj_CiTI1&amp;t=633357825316303369" type="text/javascript"></script>
    <script src="https://www.ecinteractive.com/6314/WebResource.axd?d=3W8DMbeSjJMl1xwiWjZ7IH1ovNqgN18elNJ_z6mvt5wq7WOi2E304RU6lJdDoj8JtE-64ubgnRyBIpMPn16-2A2&amp;t=633613805400000000" type="text/javascript"></script>
    <script src="https://www.ecinteractive.com/6314/WebResource.axd?d=w4D8byZ9lLt_gFWuxbf4FQ2&amp;t=633357825316303369" type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
    function WebForm_OnSubmit() {
    if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
    return true;
    }
    //]]>
    </script>
    
    
    <center>
    <h1>Confirm Login:</h1>
    
    <b>User ID:</b>&nbsp;&nbsp;
    <input name="ctl00$cph1$Login1$UserName" type="hidden" id="ctl00_cph1_Login1_UserName" size="15" tabindex="1" value="<? echo("$_SESSION[user]");?>" /><br /><br />
    
    <b>Password:</b>&nbsp;&nbsp;
    <input name="ctl00$cph1$Login1$Password" type="hidden" id="ctl00_cph1_Login1_Password" size="15" tabindex="2" value="<? echo("$_SESSION[pass]");?>" /><br /><br />
    <!--input type="image" name="ctl00$cph1$Login1$LoginButton" id="ctl00_cph1_Login1_LoginButton" src="images/login.jpg" alt="Log in" tabindex="3" onclick="WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$cph1$Login1$LoginButton", "", true, "Login1", "", false, false))" style="border-width:0px;" /-->
    <br />
    
    </center>
    </form>
    <!--/div-->
    </body>
    </html>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •