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 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 Authenticator for Exchange Server LDAP Categories : PHP , Authentication , LDAP , Security , Sessions Form Security - Match A Value For Success Categories : PHP , Authentication , HTML and PHP , Sessions , Security Password protection for Phorum 3.1.x with userlevels and log. Categories : PHP , MySQL , Authentication , Security Use of bitmasks to represent permissions Categories : PHP , Authentication , Bitwise Operators , Security , PHP Classes 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 Function to generate readable/remeberable random password Categories : PHP , Security , Security Simple Password example Categories : PHP , Authentication , Security , HTTP 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 IPhider Obscure Any URL Anonymity connection lores obfuscation corporate survival. Categories : PHP , Algorithms , Security , URLs Protect your mailto: email addresses from bots Categories : PHP , Email , Java Script PHP4 MYSQL Authentication Script with cookie. Short & Sweet
Categories : Authentication , Apache , Cookies , PHP , MySQL
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