PHP Classes

File: common.inc

Recommend this page to a friend!
  Classes of Benjamin P.   DEA   common.inc   Download  
File: common.inc
Role: Auxiliary script
Content type: text/plain
Description: useful functions - always needed
Class: DEA
An abstract deterministic finite automaton
Author: By
Last change:
Date: 21 years ago
Size: 1,801 bytes
 

Contents

Class file image Download
<?
//###########################
//# define helper-funx

$http = $HTTP_SERVER_VARS;

function
kopfHTML($title="...php driven...") {
    echo
"<html><head><title>".$title."</title></head>\n";}

function
footer() {
    echo
"</html>";}

function
printHTMLEnv( $vars = array( 0 => 'array leer' )) {

    foreach(
$vars as $key => $val ) {
        echo
"$key => $val<br>\n";
    }
}
// normal header with TITLE and BODY-Tag
function _header( $titel = '') {
    echo
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
    echo
"\n<html><head><title>".$titel."</title></head>\n";
    echo
'<body>';
    echo
"\n\n";
}

// meta-header with TITLE, META-Var and BODY-Tag
function _metaheader( $titel = '', $meta = '') {
    echo
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
    echo
"\n<html><head><title>".$titel."</title>\n".$meta."\n</head>\n";
    echo
'<body>';
    echo
"\n\n";
}

// normal header with TITLE but WITHOUT BODY-Tag
function _head( $titel = '') {
    echo
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
    echo
"\n<html><head><title>".$titel."</title></head>\n";
}

// a simple BODY-TAG (+attributes)
function _body( $bodyattrib = '') {
    echo
"\n<body ".$bodyattrib.">\n";
}

// closing the BODY and HTML-document, optionally with a auto-centered Custom-HTML
function _footer($custom_footer = '')
{
    if (
$custom_footer ) {
        echo
"\n<DIV ALIGN=\"CENTER\">".
               
$custom_footer.
               
"</DIV>\n</body>\n</html>";}
    else {
        echo
"\n</body>\n</html>";
    }
               
}

// prints anything out... (_very_useful_;) )
function _println( $content = '[line]')
{
   
$tmpHTML = "\n".$content."<br>\n";
    echo
$tmpHTML;
    return
$tmpHTML;
}