javascript blues

my question is a mulitiple one.

       I have a page at http://www.GoldoffDesigns.com/frontdoor.html on this page "frontdoor.html", i have made a password button before you can go to the next page with a simple submit button and try again button. Their's also a ketch, the key is to answer the riddle to enter the next page. My problem is I, want to know how to give out text messages when the persons get the answer wrong and when the persons gets it right. And i know you can do that with java script but i don't know how to go about it. Also when they click on the selected buttons, i want nioses to go off. One other thing is very important to my fun page. Is that i want also to give the person a time limit in trying to solve the riddle. if the person can't figure it out then the page automatically moves to another page with out them knowing. And last but not least they only get three tries then the they get zapped out to another page or something like that.
If anyone has any idea of what i'm talking about or would like to give me some of their ideas, that would be great. To get a better idea of what i'm talking about please feel free to email me anytime, i never sleep....
@ zonelove@earthlink.net
              thank you ..
              David Goldoff
freezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lasse012397Commented:
I would create a Perl script.
With cookies you could even prevent the user from earning additionat trials by reloading the page!
Textmessages can be delivered by the java function "alert". Use this sytax in javascripts:
if (conition) {
       alert("Text message");
               }

theTerabyteCommented:
Lasse is for the most part right.  it would be easier, but slower and harder at the same time to use PERL

if you ues perl, you have to use POST method so your SECRET PASSWORD isn't in the URL.  then all they have to do is use a bookmark to get past it.

also, if you use POST method with PERL you need to then dewebify it, as i like top say.

in JavaScript, though more difficult, it will be more secure and faster.  the only problem is that by selecting "view source" anyone can see the password!!!!

to fix that include the javascript in a separate file like secret.js, then they'd have to get it.  just one more thing they'd have to do.  basically, anyone could get by anything if they're determined enough!  they still could download the secret.js file, but if they're really that determined, they'll get in anyway.

so, you can use a cookie with JS to keep track of tries even if they reload, using this:

document.cookie = 'cookiename=mycookie; expires=(one day after today[must be in GMT form]); path="/"; domain=".GoldoffDesignes.com"; secure';

the best part is this way they can't try again today, but can come back tomarrow, or a week later(depending on what you set the expire for)  and try again.

also, use the alert("text here") to send text messages or
confirm("text here") to give text with ok or cancel buttons(returns true for ok and false for cancel)

like this:

if (confirm("are you sure you want to enter?")==false) {
history.back;
} else {
alert("alrighty, here you go!!!!!!!!!1");
}

any other questions leave a comment!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.