www.webdeveloper.com
Results 1 to 2 of 2

Thread: Passing the username & PAssword does not work

  1. #1
    Join Date
    Dec 2007
    Posts
    39

    Passing the username & PAssword does not work

    Hi developers,

    I have a login form which has the following code:

    Code:
    <p>
    Username:<span><input type="text" id="uid" name="uid" size="14"/> </span>
    Pass:<span><input type="password" id="pwd" name="pwd" size="14"/></span>
    <a onclick="return loginload()" href="#" class="btn">Enter</a>
    Here is the loginload script directs me to the following page upon Enter:

    Code:
    function loginload() {
    window.location="step1.asp";
    }
    Now that step1.asp gets the user & pass variables and pass them to step2.asp page that way:

    Code:
    <html> 
    <!-- #include file="include/common.asp" -->
    <!-- #include file="include/security.asp" -->
    <head>
    <meta http-equiv="Content-Language" content="tr">
    <meta name="GENERATOR" content="Microsoft FrontPage 12.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <title>Login</title>
    </head>
    
    <body background="webimages/BGS/Gray.jpg" bgcolor="#D6D6DE" topmargin="2" leftmargin="35" oncontextmenu='return false' ondragstart='return false' onselectstart='return false'>
    <form name="frm1" method="post" action="step2.asp">
    <input type="hidden" name="_uid" id="_uid">
    <input type="hidden" name="_pwd" id="_pwd">
    </form>
    
    <SCRIPT>
    document.forms[0]._uid.value = document.getElementById("uid").value;
    document.forms[0]._pwd.value = document.getElementById("pwd").value;
    document.forms[0].submit();
    </script>
    
    </body>
    
    </html>

    After clicking on Enter on the login page, I receive the error for the step1.asp page:

    Line:20
    Char:1
    Object Required
    Code:0
    Url=step1.asp

    Line 20 is the beginning of the script.


    Could not figure it out.
    Any opinions/advise are wellcome.

  2. #2
    Join Date
    Jul 2007
    Posts
    386
    Wait... you want to pass username and passwords through the URL as parameters?

    Why don't you just use a normal form?

    Code:
    <form method="post" action="step1.asp">
        Username:<span><input type="text" id="uid" name="uid" size="14"/> </span>
        Pass:<span><input type="password" id="pwd" name="pwd" size="14"/></span>
        <input type="submit" name="login" value="enter"/>
    </form>
    A hell lot easier and safer for your users.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles