AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - PHP - Password Protect - Protected Page

Password Protect - Protected Page



copy and save as 1.php - 2.php - 3.php
Change page X to page 1 - page 2 - page 3 accordingly
<? 
        include("validate.php"); 
?>
 
<html> 
<head> 
    <title>protected page</title> 
</head> 
<body bgcolor="white"> 
<table width="400" align="center"> 
<tr> 
    <th valign=top> private area </th> 
</tr> 
<tr> 
    <td> 
        <div align="right"> 
        [<a href="logout.php">Log Out</a>
        </div> 
        <a href="1.php">1</a>
        <a href="2.php">2</a>
        <a href="3.php">3</a><br> 
        <div align="center"><b>page X</b></div> 
    </td> 
</tr> 
</table> 
</body> 
</html>

Please note that you must include validate.php BEFORE you write any html to the browser

<? 
        include("validate.php"); 
?>
 

Always place the above at the top of every page you want to protect.

Finally we'll look at the logout page.


overview
the theory
the login
validation
a protected page
the logout
If you like our script, please rate it!







Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]