View Single Post
Old 03-15-2006, 01:17 PM   · #1
RageD
Senior Member
 
Name: Dennis
Location: Joliet, Illinois
Trader Rating: (42)
Join Date: Apr 2005
Posts: 1,148
NP$: 69.10 (Donate)
RageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to behold
Child Abuse
Using PHP for Password Identification!

This is an alternative to Javascript and all other ways of password identification for a page view! You can also use MySQL for multiple kinds of passwords, but if you only want a couple, this is the way to go: (This requires NO MySQL)

PHP Code:
<?php
// Let's define the page that we will see the login form & page title
$pagetitle = "Page Title Here";
if(
$page == ""){ ?>
<HTML>
<TITLE><?php echo($pagetitle); ?></TITLE>
<BODY>
<form name="login" method="post" action="?page=login">
Password: <input type=password name="password"><br>
<input type=submit value="Login"><input type=reset>
</form>
</BODY>
</HTML>
<?php
// Let's end that section with the following bracket
}
// Start the login page
if($page == "login"){
// The value '$password' comes from name="password" in the password field
    
if($password !== "PasswordHere"){
         echo(
'Incorrect Password');
         exit;
     }
     else{
          echo(
'You are now logged in!!  Page content goes here!');
     }
}
?>


-Thanks

-RageD


Please register or log-in into NamePros to hide ads
RageD is offline   Reply With Quote
Site Sponsors
EscrowDNS Find out how! http://www.mobisitetrader.com/
Advertise your business at NamePros
All times are GMT -7. The time now is 02:10 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.