Results 1 to 2 of 2

Thread: Assistance with Combining Scripts

  1. #1
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Assistance with Combining Scripts

    Hi all
    I have used many scripts from DD over the years, so now when I am stumped - I figured here was the place to turn for answers.
    I've looked around the topics for a solution, but haven't been able to find a relevant one.
    I design web sites as a hobby and comprehend graphics, etc - but scripting doesn't have to be very complicated before it's over my head.

    Here is what I've got:
    1. I found a basic javascript login on the net... it works fine.
    Yes, I know how insecure this type of login is - but it is adequate for what I am doing.

    2. On the destination page, I have a simple document.referrer script to prevent direct url entry... it works fine.

    3a. In Firefox, this setup executes without an issue - but in Internet Explorer the http referrer header returns empty, thus activating the document.referrer.

    3b. I have an Internet Explorer update script to fix the problem in 3a... it tests fine.

    Problem:
    I cannot figure out how to combine the IE update and the main script, because I don't understand html well enough.

    The main login script:

    <script language="javascript">
    <!--//
    /*This Script allows people to enter by using a form that asks for a
    UserID and Password*/
    function pasuser(form) {
    if (form.id.value=="my_username") {
    if (form.pass.value=="my_password") {
    location="points_to_the_workaround_script"
    } else {
    alert("Invalid Password")
    }
    } else { alert("Invalid UserID")
    }
    }
    //-->
    </script>

    <center>
    <table bgcolor="white" cellpadding="12" border="1">
    <tr><td colspan="2"><center><h1><i><b>Login
    Area</b></i></h1></center></td></tr>
    <tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input
    name="id" type="text"></td></tr>
    <tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="pass"
    type="password"></td></tr>
    <tr><td><center><input type="button" value="Login"
    onClick="pasuser(this.form)"></center></td><td><center><br><input
    type="Reset"></form></td></tr></table></center>


    The necessary Internet Explorer update script:

    <a href="the_destination_page"
    onleftclick="window.open('','newwin','height=1000,width=1024','')"
    target="newwin"></a>

    Any help would be greatly appreciated.
    Thanks in advance.
    Last edited by Charger27; 08-12-2008 at 03:51 AM. Reason: highlight points

  2. #2
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    A programmer friend of mine expressed some confusion as to what I am asking - perhaps that is why I am getting no responses here either.
    The frustrating part is I don't know the language to properly ask the question... so I will draw a colored layout which will hopefully make things more clear.

    Black = the main script
    Green = the supplemental script
    Red = the desired action


    <script language="javascript">
    <!--//
    /*This Script allows people to enter by using a form that asks for a
    UserID and Password*/
    function pasuser(form) {
    if (form.id.value=="my_username") {
    if (form.pass.value=="my_password") {
    location="points to the green anchor script"
    } else {
    alert("Invalid Password")
    }
    } else { alert("Invalid UserID")
    }
    }
    //-->
    </script>

    <a href="the_destination_page"
    onleftclick="window.open('','newwin','height=1000,width=1024','')"
    target="newwin"></a>


    <center>
    <table bgcolor="white" cellpadding="12" border="1">
    <tr><td colspan="2"><center><h1><i><b>Login
    Area</b></i></h1></center></td></tr>
    <tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input
    name="id" type="text"></td></tr>
    <tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="pass"
    type="password"></td></tr>
    <tr><td><center><input type="button" value="Login"
    onClick="pasuser(this.form)"></center></td><td><center><br><input
    type="Reset"></form></td></tr></table></center>


    Maybe this visual will make for an easier understanding of what I am trying to accomplish.
    I simply need some code to connect the location= to the <a href> which is neccessary for this login script to work with a document.referrer in Internet Explorer.

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
  •