login form for web statistics

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jacotheron
    New Member
    • Jan 2008
    • 44

    login form for web statistics

    Hi all

    I have a problem. I need to create a script that takes user input from a form (Username, Password, Domain) and with these input go to the page that contains their website statistics. I can't get the form to pass the input to the script to process the link and go there. Here is the code:
    Code:
    //javascript headercode:
    <script type="text/javascript"><!--
    function login (form)
    {
    var domainname = form.domainname.value;
    var username = form.username.value;
    var password = form.password.value;
    var server = "http://" + domainname + "/_system_/" + username + "/awstats/awstats.pl";
    window.location = server;
    }
    //-->
    </script>
     
    //form code:
    <form action="login" method="post" name="Log_In">
    		 <div align="center">Provide the folowing information:
    		  <p>Domain: <input type="text" name="domainname" size="24" value= ""/></p>
    		  <p>Username: <input type="text" name="username" size="24" value= ""/></p>
    		  <p>Password: <input type="text" name="password" size="24" /></p>
    		  <p><input type=button onclick="login(log_in.domainname.value)" type="submit" name="Log In" value="Log In" /></p>
    		 </div>
    		</form>
    Any help would greatly be appeciated.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The login function expects a form and you're trying to pass it the domainname field value. Change the passed value to this.form.

    Comment

    Working...