PHP Classes

File: example2.php

Recommend this page to a friend!
  Classes of Abhishek Shukla   Simple XML User System   example2.php   Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: Example Two
Class: Simple XML User System
Manage users storing their records in XML files
Author: By
Last change:
Date: 8 years ago
Size: 986 bytes
 

Contents

Class file image Download
<?php

require_once("class.simpleusersystem.php");

session_start();

$login=New simple_usersystem();

$thisuser=$login->login_form();


if(
$thisuser=="admin") $admincp=" | <a href=\"?a=admin\">Manage Users</a>";
else
$admincp="";

$menu="<h3><a href=\"?\">Home</a> | <a href=\"?p=p2\">Page 2</a>
| <a href=\"?p=profile\">Profile</a> | <a href=\"?p=contact\">Contact</a>
$admincp
| <a href=\"?logout=y\">Logout</a></h3>"
;



$home="<h2>Home Page</h2>
This is a test home page for Simple User System class by Abhishek Shukla.
<br/>"
;

$p2="<h2>Page 2</h2>This is a Page 2.";

$contact="<h2>Contact</h2>This is Contact Page.";

//homepage
   
$content=$home;
   
//other pages
if(isset($_GET['p'])) {
    switch(
$_GET['p']){
        Case
"p2";
       
$content=$p2;
        break;
   
        Case
"contact";
       
$content=$contact;
        break;
   
        Case
"profile";
       
$login->adminurl="?p=profile&";
       
$content=$login->user_profile($thisuser);
        break;
    }
}

$login->renderHTML($login->user_tool($toolmenu="n").$menu.$content);