SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 Can anyone please help me before I rip my hair out. Very very very appreciated of any help.

  2. #2
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Dan G
    Marketing Strategist & Consultant


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •