|
|
|
I used a html form that has a password field named password and a submit button named
submit. When the submit button is clicked the page reloads with the $password variable sent
back to the server. Then when php resends the html to the client it includes the appropriate
javascript to redirect them to the correct protected page.
<?php
if($password){
if($password==coach){
?>
<script language="JavaScript">
location="http://www.charlottesoccer.com/coach.php3";
</script>
<?php
}elseif ($password==admin){
?>
<script language="JavaScript">
location="http://www.charlottesoccer.com/admin.php3";
</script>
<?php
}elseif ($password==member){
?>
<script language="JavaScript">
location="http://www.charlottesoccer.com/member.php3";
</script>
<?php
}elseif ($password==guest){
?>
<script language="JavaScript">
location="http://www.charlottesoccer.com/guest.php3";
</script>
<?php
}else{
?>
<script language="JavaScript">
location="http://www.charlottesoccer.com/signin.php3";
</script>
<?php
}
}
?>
You see that as many passords as you need can be set up.
If there are a large amount of passwords it would be better to set up a select case statement.
|
|
| MD5 secured login Categories : PHP, Java Script, Authentication, Security | | | Password protection for Phorum 3.1.x with userlevels and log. Categories : PHP, MySQL, Authentication, Security | | | Form Security - Match A Value For Success Categories : PHP, Authentication, HTML and PHP, Sessions, Security | | | phpSecurePages is a PHP module to secures pages with a loginname and
password. It handles multiple user groups (each has own viewing rights),
store data in a MySQL database or a configuration file, and can be used to
identify Web site viewers. Categories : PHP, Security, Authentication | | | Authenticator for Exchange Server LDAP Categories : PHP, Authentication, LDAP, Security, Sessions | | | A damaged image generator (class) for validating text.
CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart Categories : PHP, PHP Classes, Security, GD image library, Security | | | Use of bitmasks to represent permissions Categories : PHP, Authentication, Bitwise Operators, Security, PHP Classes | | | Simple Password example Categories : PHP, Authentication, Security, HTTP | | | complete simply working javascript password generator file. Use letter, vowels, consonants (uppercase and lowercase) arrays to create a really random and secure password.
improved security using time functions to initialize random number generator. Categories : Java Script, HTML, Security, Authentication, Strings | | | A simple PHP login script that you can modify to suite your needs. It use a session to store data in a session file submited by the page. Categories : PHP, Sessions, Security, Authentication | | | PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character. Categories : PHP, Algorithms, Security, Authentication, Encryption | | | IP Blocking Categories : PHP, Security, HTTP | | | Session Validation Methods (Security Checks) Categories : PHP, Sessions, Security | | | Protect your mailto: email addresses from bots - pure PHP Categories : PHP, Email, Security | | | AJAX Data Grid System using php and mysql. A complete login system with the ability to display data in a grid using ajax. Add , update and delete the records without reloading the page. Categories : PHP, AJAX, Databases, MySQL, Java Script | |
| | | | ivan cool wrote : 612
I can`t see how this code will protect your pages. Anyone can go directly to the locations above and no testing will occcur.
| | | | yeAH fghj wrote :704
hmm maybe in combo with some other script , but this code is more usefull fore learning redirect with, as protection rather useless
| |
|
|