shb666 Posted April 26, 2007 Share Posted April 26, 2007 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. Link to comment https://forums.phpfreaks.com/topic/48721-password-protect-pages-with-the-same-password-for-every-user/ Share on other sites More sharing options...
xenophobia Posted April 26, 2007 Share Posted April 26, 2007 Yes, you can do it with PHP. Use session or cookie. Try seach for articles abou this topics. Link to comment https://forums.phpfreaks.com/topic/48721-password-protect-pages-with-the-same-password-for-every-user/#findComment-238755 Share on other sites More sharing options...
sw0o0sh Posted April 26, 2007 Share Posted April 26, 2007 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. Link to comment https://forums.phpfreaks.com/topic/48721-password-protect-pages-with-the-same-password-for-every-user/#findComment-238756 Share on other sites More sharing options...
laron Posted April 26, 2007 Share Posted April 26, 2007 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" Link to comment https://forums.phpfreaks.com/topic/48721-password-protect-pages-with-the-same-password-for-every-user/#findComment-238759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.