Location: PHPKode > projects > Open Biller > ob/global.php
<?php
/**
* Creator: Michael Bacon
* Copyright 2008 - 2009 Open Biller Project. All Rights Reserved.
* This project is open source and the copyright shall not be removed from the visible pages.
*/
error_reporting(E_ALL & ~E_NOTICE);
include('config.php');
$script_title = "Open Biller";
$version = "0.04";
$script_site = "http://www.openbiller.yourhostingtalk.com";
//Fixing windows $_SERVER[DOCUMENT_ROOT]
if(!isset($_SERVER['DOCUMENT_ROOT'])){
        if(isset($_SERVER['SCRIPT_FILENAME'])){
                $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
                };
        };

if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['PATH_TRANSLATED'])){
        $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
        };
};
$svr_root = "$_SERVER[DOCUMENT_ROOT]";          # /home/USER/public_html
$svr_domain = "http://$_SERVER[HTTP_HOST]";     # www.domain.com
$svr_rootfile = "$_SERVER[SCRIPT_FILENAME]";    #/home/USER/public_html/folder/file.php
$svr_phpself = "$_SERVER[PHP_SELF]";            # /directory/file.php

                $mystring = "$svr_domain$svr_phpself";
                $findme  = '/';
                $pos = strrpos($mystring, $findme);
                $substr = substr("$mystring", 0, $pos);
        $svr_pthself = $substr;
        
                $mystring = "$svr_rootfile";
                $findme  = '/';
                $pos = strrpos($mystring, $findme);
                $substr = substr("$mystring", 0, $pos);
        $svr_rootself = $substr;
@$SQLxxx = "SELECT * from SETTINGS"; $resultxxx = @mysql_query( $SQLxxx ); $rowxxx = @mysql_fetch_array($resultxxx);
if($rowxxx[CURRENCY] == 'USD') {$cname = 'US Dollars'; $csymbol = '$';}
if($rowxxx[CURRENCY] == 'CAD') {$cname = 'Canadia Dollars'; $csymbol = '$';}
if($rowxxx[CURRENCY] == 'EUR') {$cname = 'Euros'; $csymbol = '€';}
if($rowxxx[CURRENCY] == 'GBP') {$cname = 'Pounds Sterling'; $csymbol = '£';}
if($rowxxx[CURRENCY] == 'JYN') {$cname = 'Yen'; $csymbol = '¥';}
if($rowxxx[CURRENCY] == 'AUD') {$cname = 'Australian'; $csymbol = '$';}
if($rowxxx[CREDIT] == 'Yes') $credit = "[ <a href=\"http://www.openbiller.co.cc\" target=\"blank\">$script_title v$version</a> ]";
function cleanInput($input) {
 
$search = array(
    '@<script[^>]*?>.*?</script>@si',   // Strip out javascript
    '@<[\/\!]*?[^<>]*?>@si',            // Strip out HTML tags
    '@<style[^>]*?>.*?</style>@siU',    // Strip style tags properly
    '@<![\s\S]*?--[ \t\n\r]*>@'         // Strip multi-line comments
);
 
    $output = preg_replace($search, '', $input);
    return $output;
}
function sanitize($input) {
    if (is_array($input)) {
        foreach($input as $var=>$val) {
            $output[$var] = sanitize($val);
        }
    }
    else {
        if (get_magic_quotes_gpc()) {
            $input = stripslashes($input);
        }
        $input  = cleanInput($input);
        $output = mysql_real_escape_string($input);
    }
    return $output;
}
function copyright_text(){
global $script_title,$version,$script_site;
return '<div align="center"><font size="1">&copy 2008 - '.date("Y").' '.$script_title.' '.$version.'<br/><a href="'.$script_site.'">'.$script_title.'</a>. All Rights Reserved.</font></div>';
}
?>
Return current item: Open Biller