0

I don't know if this is possible but is it possible to disable a url address bar in the browser when a user is on a certain page? Also is the user able to disable browser buttons if a user is on a certain page?

But the twist is that it needs to work on all browsers, Chrome, Safari, IE, Opera and Firefox. It has to work on all of these browsers. Can't fail in one of these browsers which I know makes this difficult.

user1830984
  • 859
  • 3
  • 14
  • 26
  • 6
    No, absolutely not, thankfully. Why oh why would you think browsers would let websites *trap you* into never leaving? There is *nothing* even remotely close to this which will work reliably in *any* of these browsers, never mind across all of them. – user229044 Jan 07 '13 at 03:25
  • Relaying on a webbrowser to work as you want it to is a bad idea, could you explain your situation so we might be able to provide a much safer workaround? – ZombieSpy Jan 07 '13 at 03:27
  • @meagar Because I am creating an application on the browser but I do not want the user to skip pages while on certain pages in my browser. Think of this. If I want user to create something but for them to be able to create something they must go through pages 1, 2 and 3, well what happens if user is on page 1 but then manage to skip to page 3 by entering url? It knids of messes it up – user1830984 Jan 07 '13 at 03:29
  • 2
    Then you need to maintain some server-side state, and refuse to let the user advance to page 3 until page 2 is done. You would accomplish this by redirecting them to page 2 if they make an invalid request for page 3, *not* by locking down their address bar/browser buttons. This is why you should give some hint in your question of what you're trying to accomplish; had you asked this, you would've gotten useful answers. As it is you've chosen a solution (locking down the browser) which *cannot* work. – user229044 Jan 07 '13 at 03:29
  • Again dealing with page 1,2,3, if user completes page 1, data inserted in database, but then if user is on page 2 then I don't want them to go back to page 2 because I don't want them to change any details the previously entered – user1830984 Jan 07 '13 at 03:31
  • Again, you redirect them based on server-side state. If they request any page except the one they're supposed to be on, you *redirect them* to the one they're supposed to be on. That is the *only* solution to this problem. You cannot reliably solve it any other way. The user is free to request whatever URL they want of your server. The only control you have is how your server responds. Locking down the browser is not an option if this is a public Internet site. If it were a web-based kiosk, you might have some chance, but you'd *still* need to implement the redirection I'm talking about. – user229044 Jan 07 '13 at 03:32
  • @meager I will edit my question to what I wrote to you in comment – user1830984 Jan 07 '13 at 03:34
  • If you want to know more about how to do this, you should ask another question; the only answer to the question you've asked here is "No, it's not possible". – user229044 Jan 07 '13 at 03:34
  • @meagar Ok I will ask in another question. I will send a link to you if interested – user1830984 Jan 07 '13 at 03:38
  • @meagar http://stackoverflow.com/questions/14189593/dont-want-page-skipping-or-going-back-to-previous-pages-in-browser-application – user1830984 Jan 07 '13 at 03:51

2 Answers2

2

Try this page: Open new popup window without address bars in firefox & IE

But you cannot disable toolbar buttons, at least user could press backspace to go previous page.

Community
  • 1
  • 1
Vahid Farahmand
  • 2,528
  • 2
  • 14
  • 20
0

You can't dissable the navigations in a webbrowser. But there are some workarounds.

Try to use an iframe, it should ignore the webrowser's direct navigation requests?

or make ONE page with php, that changes on each step, but still is the same page (and thus you can't navigate from it)

The following code is not complete, but it should show you a way to do it.

<?php
$Step = $_SESSION["step"];

if($Step == 1 && isset($_POST["name"]))
{
    $Step = 2;
    // save name
}else if($Step == 2 && isset($_POST["description"]))
{
    $Step = 3;
    // save description
}

if($Step == 1)
{ ?>
    <html>
        <body>
            <form method="POST" action="">
                <input name="name" type="text">
                <input type="submit" value="ok">
            </form>
        </body>
    </html>
<?php }else if($Step == 2){ ?>
    <html>
        <body>
            <form method="POST" action="">
                <input name="description" type="text">
                <input type="submit" value="ok">
            </form>
        </body>
    </html>
<?php } ?>
ZombieSpy
  • 1,376
  • 12
  • 23
  • Can you show an example of using an iframe to navigate request between two pages if you don't mind? It will really help me be able to see how to code it so then I can manipulate it to fit my pages? Or show the one page with php as I just saw your update – user1830984 Jan 07 '13 at 03:33
  • No need for the down vote, he is trying hard to answer a difficult question – user1830984 Jan 07 '13 at 03:34
  • He's trying to answer a bad question (to which there is no positive answer) with a wrong answer. The downvote is not mine, but it's definitely valid. – David Thomas Jan 07 '13 at 03:39
  • @user1830984 Use a dummy page with just a iframe on it that fills the whole page, then make the iframe point to your real site. It should disable browser navigation, but is NOT safe when the users ain't stupid. – ZombieSpy Jan 07 '13 at 03:43
  • the php code i wrote is not complete (i have to sleep -.-). But it should show you the base idea – ZombieSpy Jan 07 '13 at 03:47