Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-26-2011, 04:29 PM   PM User | #1
StaticNomad
New to the CF scene

 
Join Date: Jul 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
StaticNomad is an unknown quantity at this point
Question Multiple Passwords?

Ok, I have no idea how to really even explain what's been asked of me, but it's seems to me that this could be a bit beyond my knowledge.

We're creating an alternate reality game which starts with a series of questions that people can choose from two answers. The answers will determine which path the person will travel. They'll be given a password at the end of the series of questions. There are three possible paths, which means three possible passwords given.

On the same page, beneath the questions would be a text box with a "submit" button. The password they are given would be typed in there, and then they'd proceed to the proper page. This keeps from people being able to "skip" the questions portion. What they'd proceed to next is a video which is currently being made for our event, which has hidden puzzles and clues in it to find the next password. Rinse and repeat...

My problem? How the heck do I make that box and submit button and password all work together when I have more than one password? Even more so, how do I make the password/submit button direct someone to the correct URL (without revealing the URL, and also prevents anyone from copying the URL and sharing it to bypass the password request)?

For example:

Questions are complete and the password "invention" is given.

The person types in the word invention and presses submit. It directs the to www.url.com/game1 automatically.

While someone else will come in, answer the questions, and the password "intelligence" would be given.

That person types in the word intelligence and presses submit into the same box, using the same button that the person who typed in the word invention typed in. But this person would instead be directed to www.url.com/game2

If either person shared the link they were directed to, then it'd prompt people to put in a password before letting them in.

How in the darn world do I make this happen?? LOL!

Thanks in advance for any time, advice, or tutorials provided!

---------------------------------------- Added later....

I might need to go ahead and ask this as well.. since it got me to thinking..

How would I go about hiding the URL as well. I'm only interested in doing it for the game side of the site to keep from people sharing that URL and stripping the "fun" away from the game. Hopefully it is something simple? I'm fairly new at coding. My knowledge is no where as vast as I see many others here are. So if you should decide to have the patience to assist me, please be specific in steps like you are describing this to your kid who has no idea what you're talking about. I hate to present it that way, but I don't want to annoy anyone by stating I don't understand.

Last edited by StaticNomad; 07-26-2011 at 04:52 PM.. Reason: misspelling/adding another question
StaticNomad is offline   Reply With Quote
Old 07-26-2011, 04:41 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,038
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Passwords using Javascript are hopelessly insecure as the user can simply use View Source to inspect them. Likewise URLs. It is possible to obfuscate them to some extent, but even so anyone familiar with Javascript will be able to quickly crack them. You need to use server-side coding.

To answer your question:-

if (password == "invention") {dothis()}
if (password == "zamboni") {dothat()}
if (password == "intelligence") {dosomethingelse()}

But I have to say that I get the impression that you are trying to do something which is beyond your skills and abilities at present.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Last edited by Philip M; 07-26-2011 at 04:55 PM.. Reason: Typos
Philip M is offline   Reply With Quote
Users who have thanked Philip M for this post:
StaticNomad (07-26-2011)
Old 07-26-2011, 05:40 PM   PM User | #3
StaticNomad
New to the CF scene

 
Join Date: Jul 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
StaticNomad is an unknown quantity at this point
Quote:
Originally Posted by Philip M View Post
But I have to say that I get the impression that you are trying to do something which is beyond your skills and abilities at present.
This is an understatement. LOL! I am intently trying to learn, research, and comprehend and feel like I've got a brick wall in my brain refusing information to penetrate and retain.

I cannot believe I forgot about view-source. I use it frequently to learn with, and just entirely forgot it allows for passwords to be found very easily. Thank you for pointing that out. Now I need to figure out what you just said to me and what it means. At least it gives me a place to start.

Any ideas on the other portion of my question, by chance?
StaticNomad is offline   Reply With Quote
Old 07-26-2011, 06:51 PM   PM User | #4
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,038
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by StaticNomad View Post
Any ideas on the other portion of my question, by chance?
If that was how to stop the user viewing an URL, see my answer at Post #2.
You need to use server-side coding. I have the idea that is completely beyond you at the moment. Computer programming in any language cannot be learned in a few days, weeks or months.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 07-27-2011, 01:38 PM   PM User | #5
StaticNomad
New to the CF scene

 
Join Date: Jul 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
StaticNomad is an unknown quantity at this point
Well, I appreciate the small tip you gave for me to go hunt for further information anyway. In the mean time, I am still adamantly trying to learn. So far, I've taught myself everything else that I know. I figure if you have the drive, you can learn as fast as you want. But I'm a bit of an optimistic too. LOL Never hurts to ask and see who's willing to share knowledge either. It's refreshing to not run into pretentious jerks who withhold knowledge just to feel bigger and smarter. I sincerely appreciate your time! At least now I know what to ask for in help down the line!
StaticNomad is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:58 PM.


Advertisement
Log in to turn off these ads.