Location: PHPKode > scripts > Application Framework Classes > application-framework-classes/http.class.php
<?php 
/* 
 *(c) 2003 christoph althammer hide@address.com  
 *         http://www.milpa.de
 *
 *         GNU GENERAL PUBLIC LICENSE
 *         die deutsche √úbersetzung der GPL ist zu finden auf www.suse.org.
 *
 *  auth: c. althammer
 *  date: 2003-03-03
 *	mod : http vars
 *
 */

class Post 		extends HTTPVar {}
class Fetch 	extends HTTPVar {}

class HTTPVar {
/* post get etc */

var $GetVars                         = array();
var $PostVars                        = array();
function Get($Value=""){
                global $HTTP_GET_VARS;
                //new Debug("fetch GetVar '$Value' value (".$HTTP_GET_VARS["$Value"].")");
                if (isset($HTTP_GET_VARS["$Value"])) $Var = $HTTP_GET_VARS["$Value"];
                        /*elseif($this->SessionFetch($Value)) $Var        = $this->SessionFetch($Value);*/
                                else $Var        = false;
                        return $Var;
                }
function Post($Value=""){
                global $HTTP_POST_VARS;
                //new Debug("fetch PostVar '$Value' value (".$HTTP_GET_VARS["$Value"].")");
                if (isset($HTTP_POST_VARS["$Value"])) $Var = $HTTP_POST_VARS["$Value"];
                        /*elseif($this->SessionFetch($Value)) $Var        = $this->SessionFetch($Value); */
                                else $Var        = false;
                return $Var;
                }
function Fetch($Value=""){
                global $HTTP_POST_VARS;
                global $HTTP_GET_VARS;
                global $HTTP_SESSION_VARS;

                if (isset($HTTP_POST_VARS["$Value"]))         {
                        $Var = $HTTP_POST_VARS["$Value"];
                        //session_unregister("$Value");
                        $Method = "POST";
                        }
                        elseif (isset($HTTP_GET_VARS["$Value"]))         {
                        $Var = $HTTP_GET_VARS["$Value"];
                        //session_unregister("$Value");
                        $Method = "GET";
                        } elseif(isset($_SESSION["$Value"])) {
                                $Var        = $_SESSION["$Value"];
                                $Method        = "SESSION";
                                }
                                else {
                                        $Var        = false;
                                        new Debug("Fetch Var FAILED!");
                                        }

                new Debug("Fetch Var Method=$Method Value of '$Value'='$Var' ");
                return $Var;
                }				
function GetOrPost($Value=""){
                global $HTTP_POST_VARS;
                global $HTTP_GET_VARS;

                if (isset($HTTP_POST_VARS["$Value"]))         {
                        $Var = $HTTP_POST_VARS["$Value"];
                        //session_unregister("$Value");
                        $Method = "POST";
                        }
                        elseif (isset($HTTP_GET_VARS["$Value"]))         {
                        $Var = $HTTP_GET_VARS["$Value"];
                        //session_unregister("$Value");
                        $Method = "GET";
                        } else {
                                        $Var        = false;
                                        new Debug("GetOrPost Var FAILED!");
                                        }

                new Debug("Fetch Var Method=$Method Value of '$Value'='$Var' ");
                return $Var;
                }
function SessionFetch($SValue=""){
        global $HTTP_SESSION_VARS;
        if        (isset($_SESSION["$Value"])) {
                $SVar        = $_SESSION["$Value"];
                new Debug("Restored Var '$SValue'='$SVar' from an old Session");
                }        else $SVar        = false;
        return $SVar;
}
function RemoteUser(){
                global $REMOTE_USER;
                if (empty($REMOTE_USER)) $UserName        = "Anonymous"; else $UserName = $REMOTE_USER;
                return $UserName;
                }
function ServerName(){
                global $SERVER_NAME;
                return $SERVER_NAME;
                }
function GenerateDate($Offset=""){
                return date("d.m.Y", mktime(0,0,0,date("m"),date("d")+$Offset,date("Y")));
                }
function SelfUrl(){				
                global $PHP_SELF;
				return $PHP_SELF;
                }
}






?>
Return current item: Application Framework Classes