SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    0 Post(s)
    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


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


    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
    0 Post(s)
    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


Posting Permissions

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