PHP Classes
Icontem

File: adminpro_example.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Giorgos  >  AdminPro class  >  adminpro_example.php  
File: adminpro_example.php
Role: Example script
Content type: text/plain
Description: An example of a password protected page
Class: AdminPro class
MySQL/Session based user authentication/management
 

Contents

Class file image Download
<?php
/*
Please, create first the MySQL table and add some users.
To start this example please change the form action value in the default login page to the name of this page:
e.g <form action="adminpro_example.php" method="POST">.
In this example only administrators and normal users of the group '2' will have access.
If only administrators and normal users of the group e.g '5' should have access, set: new protect("0","5").
If only administrators should have access, set: new protect("1").
If all users should have access, set: new protect().
*/
include("adminpro_class.php");
$prot=new protect("0","2");
if (
$prot->showPage) {
$curUser=$prot->getUser();
?>
<html>
<head>
<title>AdminPro Class v1.3 Example Page</title>
<style type="text/css">
<!--
body {font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 12px; text-align: center; font-weight: normal;}
h1 {font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 28px; text-align: center; font-weight: bold;}
input#button {font-family: Helvetica, Tahoma, Arial, sans-serif; border: 2px; bordercolor:silver; font-size: 11px; font-weight: bold;}
-->
</style>
</head>
<body bgcolor="#e9e9e9">
<center>
<h1>AdminPro Class v1.3 Example Page</h1>
<p><i>This could be the first page in your password protected area.</i></p>
<p><i>Here could follow your PHP and HTML code...</i></p>
<p><?php echo ("You are logged in as: <b>".$curUser)."</b>"?> [using function <b>getUser()</b>]</p>
<p><form action="" method="POST">
<input type="hidden" name="action" value="logout">
<input type="submit" id="button" value="Logout">
</form></p>
</body>
</html>
<?php
}
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products