There are 3 parts to the secure login script:
First is the login form:
[code]<?php echo "<table border='1' CELLPADDING=0 CELLSPACING=0 STYLE='font-size:13px'>"; ?>
<tr>
<td>
<form action="verifylogin.php" method="post">
<div align="right">
Login ID: <input type="text" name="loginid" id="loginid"><br>
Password: <input type="password" name="pword" id="pword"><br>
<input type="submit" name="submit" value="Login" style="height: 25px; width: 65px">
</div>
</form>
</td>
</tr>
</table>[/code]
Second is the login verification page:
[code]<?php
$LoginID = $_POST['loginid'];
$Password = $_POST['pword'];
$g46690sgkiwdr54 = "g46690sgkiwdr54";
if($LoginID == "username" && $Password == "password")
{ include("memberpage.php"); }
else
{ echo "<center>Invalid Login ID or Password Please Try Again</center>";
include("login.php"); }
?>[/code]
Third is the page that is accessed if login and password is correct otherwise it returns to the login page. It also goes to the login page if you try to come to this page via bookmark or any direct link:
[code]<?php
if(isset($g46690sgkiwdr54)) {
// Stick your page in here
echo "<center>";
echo "Welcome to the Members Area";
echo "</center>";
} else {
include("login.php");
}
?>[/code]
This has been posted assuming that you have a little php experience if you have any questions about how to implement these scripts on your site please ask here.
