PHP Classes
elePHPant
Icontem

File: phpsecureweb/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Bulent Tezcan  >  phpsecureweb  >  phpsecureweb/index.php  >  Download  
File: phpsecureweb/index.php
Role: Application script
Content type: text/plain
Description: remove this file or integrate it to your site.
Class: phpsecureweb
Allow users certain rights, login with password.
Author: By
Last change:
Date: 12 years ago
Size: 1,672 bytes
 

Contents

Class file image Download
<?php
   
/*
    * @author Bulent Tezcan. bulent@greenpepper.ca
    */

   
session_start( );

    require_once
"Form.class.php";
   
   
ob_start( );

    include
"header.inc.php";

    if (
$_GET['isOK'] == 'OK')
    {
       
$FormElements['__error'] = "Thank you. We hope you found it useful.";
       
$_SESSION['resetDatabaseError'] = "";
    }
    elseif(
$_GET['isOK'] == 'ERROR')
       
$FormElements['__error'] = $_SESSION['resetDatabaseError'];

   
$myForm = new Form("login");
   
$myForm-> SetNumberOfColumns( 2 );
   
$myForm-> SetCellSpacing( 1 );
   
$myForm-> SetCellPadding( 5 );
   
$myForm-> SetBorder ( 0 );
   
$myForm-> SetAlign ("center");
   
$myForm-> SetTableWidth ("400");
   
$myForm-> SetTableHeight (null);
   
$myForm-> SetCSS ( $_SESSION["CSS"] );
   
$myForm-> SetEmptyCells (false);
   
$myForm-> SetFormHeader("<font class=\"".$_SESSION["CSS"]."FormHeaderFont\">Welcome to Security Demo</font>");


   
$myForm-> SetErrorMessage($FormElements['__error']);
       
   
$label = new Label("lbl1","After you are done with the testing,<br>PLEASE reset the database for others.<br><br>User : admin<br>Password: secret");
   
$label-> SetColspan(2);

   
$myForm-> AddFormElementToNewLine($label);

   
$adminMenu = "\n<a class=\"".$_SESSION["CSS"]."LinkButton\" href=\"adminmenu.php\">Start the Demo</a>";

   
$passtru = new PassTru();

   
$passtru->SetValue($adminMenu);
   
$passtru->SetClass("DataTD");

   
$myForm-> AddFormElementToNewLine($passtru);

   
$passtru->SetValue("\n<a class=\"".$_SESSION["CSS"]."LinkButton\" href=\"resetDatabase.php\">Reset the Database</a>");
   
$myForm-> AddFormElement($passtru);

    echo
$myForm-> GetFormInTable( );

    include
"footer.inc.php";

   
ob_end_flush( );
?>