Check if password is correct then forward to next page PHP?

  • Thread starter Thread starter Rathie
  • Start date Start date
R

Rathie

Guest
Hey,

I'm making a web quest and I have got text box, which checks the password against a pre-defined one in a javascript code. I was wondering anyone could give me something i could copy and paste straight onto my webserver which could do all this in PHP and then forward the person onto the next page if the password matches.
By saying password, i mean the answer to the question which i am asking on the page. Not a password as such, but the answer.
By saying password, i mean the answer to the question which i am asking on the page. Not a password as such, but the answer.
By saying password, i mean the answer to the question which i am asking on the page. Not a password as such, but the answer.
 
First don't put a predefined password in javascript code. This kind of defeats the purpose of having a password, since everyone and thier mother can view the source of the javascript code and find out what the password is.

Next, there isn't really a need to do this with a script since most modern webservers like IIS and Apache allow you to set up predefined user/password for directory and files.

If your using Apache look into Mod Authn, more specifically goot .htacess files for information on how to do this.
 
Back
Top