Password to Page.html

Hey everyone,
Man I’m about to lose it!!! I’ve been googling for days but I can’t find what I’m looking for. I need to have a simple text input field on a html page. It needs the users to type in either

‘pass1’
‘pass2’
‘pass3’

and depending on whats entered this will then take them to the corresponding

page1.html
page2.html
page3.html

Is this possible with javascript? It sounds simple enough but I just can’t figure it out :frowning: Can anyone please help me before I rip my hair out. Very very very appreciated of any help.

I haven’t used Javascript for something like this, but I’m sure it’s possible with javascript - search for Javascript redirect onclick.

However, I would strongly advise against using Javascript for this, it’s not very secure and for those that don’t have Javascript enabled, it won’t work. I’d look into using php or another server side language for this.

very basic summary of what you need for php:

  • an html form, action set to your php file (can even be the same file)
  • the php script consist a simple switch
  • and then using include to fetch the relevant page

that should help you get started when you’re going to use the php approach, if not let me know.