-1

Hi i am tryng to implement a web application and i was wondering if html offers any page navigation techniques. My query is Am going like this in my current page navigation,

Page A --> Page B --> Page C --> Page B

if i press back from this Page B position it will go to Page C, I dont want that to happen, instead, i want it to go to Page A.

The reason is that consider

Page A as login page

Page B as home page with some options, when clicked on any one it will go to Page C

Page C corresponding clicked function, say text boxes where i can input name, address etc, and when i fill and click on submit, it will go to page B.

Now if i press on back button from this Page B, i will be navigated to Page C. I dont want this to happen, i just want to stay in that page in this case.

but if the scenario was like this

A->B->C->D->C.. 

then on pressing back from last C i need to go to B, and if i press back from B, either stay on that page or prompt me to logout.

Hope my question is clear please dont down vote this, i want to learn, only these forums are there to help me

Please help

Mukund
  • 1,107
  • 2
  • 18
  • 40
  • 1
    _if html offers any page navigation techniques_??? Really? Also.. why did you tag PHP? Are you doing anything with that? – putvande Jun 24 '14 at 12:35
  • http://stackoverflow.com/questions/18208789/html-5-page-navigation – Vikas Gautam Jun 24 '14 at 12:37
  • i am using php in that web application, all pages are saved with .php, also i use within html pages – Mukund Jun 24 '14 at 12:39
  • is my question clear? – Mukund Jun 24 '14 at 12:40
  • 2
    Trying to override the behavior of the back button is both difficult and highly annoying to users. It's best not to do it. Provide the navigation your users will need in the design of the application itself, not by trying to break the user's browser. – David Jun 24 '14 at 12:41
  • so shall i disable backbutton and make a button in the page itself for the navigation? – Mukund Jun 24 '14 at 12:43
  • HTML is page navigation (as well as building the page, filling the page, and even styling the page to an extent) so yes, there is a lot of techniques in HTMl for navigation. – Sam Denton Jun 24 '14 at 12:52

2 Answers2

2

The browser-back-button belong to the user. Its a "go back in history"-button. so ... imo dont touch it. provide a useful navigation so that user dont even think about using the back-button =)

cottton
  • 1,522
  • 14
  • 29
1

There are two ways to do this as far as i am aware. Personaly i would use JS to create a simple logon page, that opens a page containing an iframe, which is linked to your site. If the user hits back, it will take them to the logon page, as the site is contained within an iframe.

The other way is to change the propertys of the back button, rather than removing it with JS. I think this can be done with.history, but i have never used personaly so i dont know.

Hope this helps :)

Sam Denton
  • 465
  • 3
  • 18