PHP Classes
elePHPant
Icontem

File: _app.inc

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michael J. Fuhrman  >  Ladder PHP  >  _app.inc  >  Download  
File: _app.inc
Role: Example script
Content type: text/plain
Description: Links into Ladder and calls your page
Class: Ladder PHP
Manage objects stored MySQL database dynamically
Author: By
Last change: added the function gblLadder() which returns the $gblLadder global variable. Globals require the programmer to remember to put 'global $gblLadder;' at the beginning of the functions that use the global variable. A better way to treat global variables is as global functions.
Date: 4 years ago
Size: 2,304 bytes
 

Contents

Class file image Download
<?
/* =======================================
    Copyright 1998, 2000, 2003, 2007, 2009 - E Net Arch
        www.ENetArch.net - 248-686-1407
        ENetArch on AIM, Yahoo, and Skype

    This program is distributed under the terms of the GNU
    General Public License (or the Lesser GPL).
    ======================================= */

  
Include_Once ("functions.cls");
   Include_Once (
"Ladder_Ladder.cls");

//***************************************************************
//*
//* Database Connection
//*
//***************************************************************

$szODBC = "HOST=localhost;UID=sa;PSW=psw;DBF=development;";
$gblLadder = null;
$szIP = getenv ("REMOTE_ADDR");
$szURLPath = "";

// ==========================================

function gblLadder() { global $gblLadder; return ($gblLadder); }

// ==========================================


//*--------------------------------------------------------------
//* main Loop to process tokens.
//*--------------------------------------------------------------

Main ();

Function
Main ()
{
   
session_start();

   
Connect ();
   
   
php_Main ();
   
   
Disconnect ();
}

//*--------------------------------------------------------------
//* Connect to Ladder
//*--------------------------------------------------------------

Function Connect()
{
    Global
$gblLadder;
    Global
$szODBC;
   
   
$gblLadder = new ldrLadder ();

   
$gblLadder->Connect ($szODBC);
}

//*--------------------------------------------------------------
//* Disconnect from the store
//*--------------------------------------------------------------

Function Disconnect()
{
    Global
$gblLadder;
   
   
$gblLadder->Disconnect();
}

/* ===============================================

2010-07-29 - added session_start to the Main() function
   as sessions are a regular part of every application
   I build on top of Ladder.

2010-07-29 - added the function gblLadder() which
   returns the $gblLadder global variable. Globals
   require the programmer to remember to put
   'global $gblLadder;' at the beginning of the
   functions that use the global variable. A better
   way to treat global variables is as global functions.


   ===============================================
*/

?>