Removing the History?

Discussion in 'Javascript' started by George Hester, Oct 17, 2004.

  1. A user comes to the site and is presened with a Logon page. They enter the correct info in the
    form and they are in. I am doing it like this:

    <head>
    <script type="text/javascript">
    function form_onsubmit(){
    window.location.replace('/yourin.asp');
    return true;
    }
    </script>
    </head>
    <!-- -->
    <form method="post" name="frmLogon" id="frmLogon">
    <input type="submit" ...>
    <input type="reset" ... >
    </form>
    <!-- -->
    <script type="text/javascript">
    document.forms('frmLogon').onsubmit = form_onsubmit;
    </script>
    <!-- -->

    The idea was to remove the history. In other words to not allow Back to be used to return to
    the logon page. This doesn't work the back in history is still available. Any suggestions how it can be done? Thanks.

    --
    George Hester
    __________________________________
    George Hester, Oct 17, 2004
    #1
    1. Advertising

  2. George Hester

    Lee Guest

    George Hester said:
    >
    >A user comes to the site and is presened with a Logon page. They enter =
    >the correct info in the
    >form and they are in. I am doing it like this:
    >
    ><head>
    ><script type=3D"text/javascript">
    >function form_onsubmit(){
    > window.location.replace('/yourin.asp');
    > return true;
    >}


    By returning true from the onSubmit handler, you're telling the
    browser to replace the current page, and also to submit the form,
    which also loads a new page (itself). Since you don't seem to
    want to submit anything to the server, don't use a submit control.
    Use a button with an onClick handler.
    Lee, Oct 17, 2004
    #2
    1. Advertising

  3. George Hester

    Randy Webb Guest

    George Hester wrote:

    > A user comes to the site and is presened with a Logon page. They enter the correct info in the
    > form and they are in. I am doing it like this:
    >
    > <head>
    > <script type="text/javascript">
    > function form_onsubmit(){
    > window.location.replace('/yourin.asp');
    > return true;


    return false;

    > }
    > </script>
    > </head>
    > <!-- -->
    > <form method="post" name="frmLogon" id="frmLogon">


    <form onsubmit="return form_onsubmit()".......>

    > <input type="submit" ...>
    > <input type="reset" ... >
    > </form>
    > <!-- -->
    > <script type="text/javascript">
    > document.forms('frmLogon').onsubmit = form_onsubmit;
    > </script>


    Get rid of that garbage script above.

    > <!-- -->
    >
    > The idea was to remove the history.


    Leave my history alone. But anyone that wants in your site can get in
    directly. You are aware of that, right?

    > In other words to not allow Back to be used to return to
    > the logon page. This doesn't work the back in history is
    > still available. Any suggestions how it can be done? Thanks.


    Yes, and a more reliable way. Have the form submit to itself, and
    redirect accordingly. All it takes now is to view source and go directly
    to yourin.asp

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 17, 2004
    #3
  4. "Randy Webb" <> wrote in message news:...
    > George Hester wrote:
    >
    > > A user comes to the site and is presened with a Logon page. They enter the correct info in the
    > > form and they are in. I am doing it like this:
    > >
    > > <head>
    > > <script type="text/javascript">
    > > function form_onsubmit(){
    > > window.location.replace('/yourin.asp');
    > > return true;

    >
    > return false;
    >
    > > }
    > > </script>
    > > </head>
    > > <!-- -->
    > > <form method="post" name="frmLogon" id="frmLogon">

    >
    > <form onsubmit="return form_onsubmit()".......>
    >
    > > <input type="submit" ...>
    > > <input type="reset" ... >
    > > </form>
    > > <!-- -->
    > > <script type="text/javascript">
    > > document.forms('frmLogon').onsubmit = form_onsubmit;
    > > </script>

    >
    > Get rid of that garbage script above.
    >
    > > <!-- -->
    > >
    > > The idea was to remove the history.

    >
    > Leave my history alone. But anyone that wants in your site can get in
    > directly. You are aware of that, right?
    >
    > > In other words to not allow Back to be used to return to
    > > the logon page. This doesn't work the back in history is
    > > still available. Any suggestions how it can be done? Thanks.

    >
    > Yes, and a more reliable way. Have the form submit to itself, and
    > redirect accordingly. All it takes now is to view source and go directly
    > to yourin.asp
    >
    > --
    > Randy
    > comp.lang.javascript FAQ - http://jibbering.com/faq


    Randy you cannot get into the site other then how I let you in. Guarenteed. You make think you are in but you are not.

    As proof what is Osma's dream? You find that on the home page. If you can answer that then you are pretty good.

    If you can answer it then you have asked for the user/pass which has no restrictions but without it I doubt it.

    In any case thanks for the suggestions. I did do it using Server Side stuff.

    --
    George Hester
    __________________________________
    George Hester, Oct 17, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bob

    drop down history

    bob, Oct 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,859
    Leon Mayne [MVP]
    Oct 26, 2005
  2. Chris  Chiasson
    Replies:
    6
    Views:
    596
    Richard Tobin
    Nov 14, 2006
  3. Sam Stephenson
    Replies:
    1
    Views:
    211
    Andrew Walrond
    Jun 18, 2005
  4. Replies:
    2
    Views:
    264
    nutso fasst
    Oct 17, 2006
  5. Niall
    Replies:
    3
    Views:
    149
    Niall
    Dec 6, 2006
Loading...

Share This Page