Results 1 to 6 of 6

Thread: password script help please!!

  1. #1
    Join Date
    Mar 2006
    Location
    Kansas City
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default password script help please!!

    Hi, I need help with the var location (see script code below), please let me know where I can put this custom URL in so that when it's call it know where to go. Because the way the code was written it goes to root. Here is my URL where I intent to put in place of the root.

    http://gpu_ln02.us.grundfos.com/C125730D0046258B/webImages/biggestloser.html/$File/biggestloser.html

    (below is a snipplets from http://www.javascriptkit.com/script/cut34.shtml)


    <SCRIPT LANGUAGE="JavaScript">
    <!--- Hide from tired old browsers that should be put to pasture.

    ////////////////////////////////////////////////////////////////////
    /// Get your very own Gate Keeper from Professional Web Design ///
    /// http://junior.apk.net/~jbarta/weblinks/gate_keeper/ ///
    ////////////////////////////////////////////////////////////////////

    function goForit() {
    var location;
    var password;
    password=this.document.testform.inputbox.value
    location=password + ".html"
    fetch(location)
    theKeeper=window.close()
    }

    function fetch(location) {
    var root;
    if (opener.closed) {
    root=window.open('','theKeepersGopher','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
    root.location.href = location;
    } else {
    opener.location.href = location;
    }
    }

    // End hiding --->
    </SCRIPT>

    Thanks in advance...

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    If I understand what your saying I'd say replace:
    Code:
    location=password + ".html"
    With:
    Code:
    location="http://gpu_ln02.us.grundfos.com/C125730D0046258B/webImages/biggestloser.html/"+password+"/biggestloser.html";
    Jeremy | jfein.net

  3. #3
    Join Date
    Mar 2006
    Location
    Kansas City
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Excellent, I will give it a shot tomorrow and post my finding. I appreciated your help. Thanks.

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I'm glad to help you Comaiwat. I hope it works!
    Your welcome!

    Javascript is not the best way to do this though. If you have php enabled you can do this:
    PHP Code:
    <?php
    if(isset($_POST['submit'])){
      if(empty(
    $_POST['pass'])){
        die(
    'Empty location, can\'t go anywhere!');
      }
      
    header("Location: http://gpu_ln02.us.grundfos.com/C125730D0046258B/webImages/biggestloser.html/".$_POST['pass']."/biggestloser.html");
    }
    ?>
    Last edited by Nile; 02-03-2009 at 04:21 AM.
    Jeremy | jfein.net

  5. #5
    Join Date
    Mar 2006
    Location
    Kansas City
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Nile, I understand completely and our domino server does not allow us to use PHP. I'm basically messing with our intranet site and I don't really care if some can hack into it. I'm a designer working on the site and tring to get some advice on scripting. I got the popup to entered the password it works great, except when it goes to the new "pasword" protected site it launched on to itself the "popped up" box. How can I have it launch on to the parent window? The original script I grabbed this from works fine, but I don't know why mine doesn't work like its suppose to. Here is where I grabbed the URL http://www.javascriptkit.com/script/cut34.shtml any suggestions? Also the link below show you the video capture of what's happening, if you care to watch it.
    http://screencast.com/t/Lmd5b1sM
    sorry, I forgot to adde the current code... I made few adjustment... specifically the window.location if I don't have window. then it won't go to the URL at all. So, I had to add that.

    <SCRIPT LANGUAGE="JavaScript">
    <!--- Hide from tired old browsers that should be put to pasture.

    ////////////////////////////////////////////////////////////////////
    /// Get your very own Gate Keeper from Professional Web Design ///
    /// http://junior.apk.net/~jbarta/weblinks/gate_keeper/ ///
    ////////////////////////////////////////////////////////////////////

    function goForit() {
    var location;
    var password;
    password=this.document.testform.inputbox.value
    window.location="http://gpu_ln02.us.grundfos.com/C125730D0046258B/webImages/biggestloser.html/$File/"+password+".html"
    fetch(location)
    theKeeper=window.close()
    }

    function fetch(location) {
    var root;
    if (opener.closed) {
    root=window.open('','theKeepersGopher','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
    root.location.href = location;
    } else {
    opener.focus()
    opener.top.location.href = location;
    }
    }

    // End hiding --->
    </SCRIPT>

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Try the window.parent method. Found here.
    Jeremy | jfein.net

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
  •