I have developed a php form where the first page is used to have the user log on.
But when they get to the second page, how do I disable the browser back button, so that they can't go back from second page to the first.

Thanks in advance for the help

    I don't think you can. If you used javascript to open the pages in a new window without any buttons, then that'd make it hard for people to use the back button.

    You could also use javascript to close the current window and open a new one, so that there is no previous page, but I imagine that'd cause all sorts of problems and really annoy visitors.

      try http://javascript.internet.com for a javascript.

      Another suggestion is to hardcode some simple PHP into your pages.

      I suggest that on the 2nd page you creat a session variable or set a cookie with a certain value. Then on the first page write some code that will not allow the visitor to view that page with the session variable set or the cookie set.

      This of course is only suitable for one, maybe two or three pages. Otherwise you'll be dealing with loads of variables bouncing all over the place!

      Hope that helps?

        Thank you for your suggestions.

        I will try that. I will only be adding session variables in two pages.

        Thanks again.

          There is no point in using javascript and trying to disable the back button, users can turn javascript off.

            Do you have any suggestion then.
            Thanks for the help.

              Funny, I was just playing around with writing a "client" for a site I am working on. The program would be a basic web browser WITHOUT a back button and only allow users to go to one page.

              Anyone else interested?

                Originally posted by greg252
                Funny, I was just playing around with writing a "client" for a site I am working on. The program would be a basic web browser WITHOUT a back button and only allow users to go to one page.

                Anyone else interested?

                You may think you have a nice idea and i have nothing agasint it but the reason the back button is on the browser is because internet users like to be able to go back from where they last came from. Disabling the back button on the browser will still allow the user to right click and go back. Or even if disperate turn JS off.

                Also with your project you are taking up im assuming you would need to allow the user only to use that browser when visiting that site else the user will still have the back button enabled. Which i do not think many users will be happy to do so they will move on.

                  planetsim.
                  Think of it this way:
                  A nice, pretty icon sits on the client desktop. Double clicked, it goes to the admin section of the site, asks for a password (as usual). It looks more like an application than a browser because 1) No resize- I can design with pix because I will know the client's resolution, 2) no address bar 3) no buttons across the top.

                  It puts a lot of emphasis on good navigation within the admin section.

                  I was even thinking of compiling the "browser" with the website logo (specific to each website).

                  It's just an idea right now.

                    Write a Reply...