Sending message on load

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Francis Lewis

    #1

    Sending message on load

    Hi there - I have a need for a page to pop up a user/password dialogue
    when it loads and for the user/password that they enter to be sent to
    be logged somewhere on the server. The underlying page then loads as
    normal. Does anyone have an idea about how I might do this?
  • Lasse Reichstein Nielsen

    #2
    Re: Sending message on load

    Francis.Lewis@r bos.com (Francis Lewis) writes:
    [color=blue]
    > Hi there - I have a need for a page to pop up a user/password dialogue
    > when it loads and for the user/password that they enter to be sent to
    > be logged somewhere on the server. The underlying page then loads as
    > normal. Does anyone have an idea about how I might do this?[/color]

    Use HTTP authentication instead of doing it in Javascript. How to do that
    depends on the web server (I believe Apache uses the .htaccess file).

    If you want to log it on the server, you will most likely need

    If you insist on using Javascript, you must either create the interface
    yourself, or use two prompt's.

    function formEncode(s){
    return escape(s.replac e(/ /g,"+"));
    }

    function bugUser() {
    var user = formEncode(prom pt("Username:") );
    var passwd = formEncode(prom pt("Password:") );
    var dummy = new Image():
    dummy.src = "noImage.png?us er="+user+"&pas swd="+passwd;
    // find it in the logs if you don't have server side scripting.
    }

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • asdf asdf

      #3
      Re: Sending message on load

      Here's one idea:

      If you're in IE, you can use window.showModa lDialog.

      In the modal popup, you can have code to perform the login logic and
      set the window.returnVa lue to true or false before closing.

      Then, in the main window you can check the return value of the
      function call and act accordingly.

      Lasse Reichstein Nielsen <lrn@hotpop.com > wrote in message news:<llszk3bq. fsf@hotpop.com> ...[color=blue]
      > Francis.Lewis@r bos.com (Francis Lewis) writes:
      >[color=green]
      > > Hi there - I have a need for a page to pop up a user/password dialogue
      > > when it loads and for the user/password that they enter to be sent to
      > > be logged somewhere on the server. The underlying page then loads as
      > > normal. Does anyone have an idea about how I might do this?[/color][/color]

      Comment

      • Lee

        #4
        Re: Sending message on load

        asdf asdf said:[color=blue]
        >
        >Here's one idea:
        >
        >If you're in IE, you can use window.showModa lDialog.
        >
        >In the modal popup, you can have code to perform the login logic and
        >set the window.returnVa lue to true or false before closing.
        >
        >Then, in the main window you can check the return value of the
        >function call and act accordingly.[/color]

        I could access the site using some other browser and read the password
        from the JavaScript source, or simply find out what "act accordingly"
        means in this case, and do that.

        Comment

        Working...