Jump to content

Password protect pages with the same password for every user.


shb666

Recommended Posts

I am building a site where every user has to enter a password to go to the next page.

The passwords will be the same for everyone.

 

So for example, to go from page A to B everyone has to type the word "swordfish" into a box at the bottom of page A

And to then go from page B to C everyone as to type "afghanistanbananastan" at the bottom of page B etc.

 

Is this something I would use php to do and if so how?

 

I don't want people to be able to view the source and see the passwords.

 

Thanks.

IF($_GET['page'] == 'A' && $_POST['password'] == 'swordfish'){

// echo contents of page B

} else {

// your passwords phailz.

}

 

 

PHP isnt available through source, its a series of commands that interacts with your hosts server.

if you want a diffrent password to access each new page, you can use cookies and sessions (mentioned above) or you can write the code to check the password on each new page. 

 

PHP isnt available through source, its a series of commands that interacts with your hosts server.

 

so in other words you cant view the source ex. a php command would be <?php echo "hello" ?> all you would see in your "view source" would be "hello"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.