Free Software Server Environment : ClassPhp

HomePage :: Categories :: PageIndex :: RecentChanges


Search this site: FSSE.INFO is produced by "osde8info" :

cls.hub.php

<?
class phpmysqlform
{
    var $tablename ;
    var $keys ;
    var $keyvalues ;
   
    function phpmysqlform( $tablenames)
    {
        // mydebug ( $_REQUEST) ;
       
        // mydebug ( $_SESSION) ;
       
        $this -> tablename = $tablenames[0] ;

        $this -> fields = $fields ;
       
        $this -> keys = fieldkeys( $this -> tablename ) ;

        // first update if requested
       
        if (isset($_REQUEST['update'])) $this -> formdataupdate() ;
       
        foreach ($this -> keys as $name => $val)
        {
            if ($_REQUEST[$name]) $_SESSION[$name] = substr( $_REQUEST[$name], 0, 3 ) ;

            if (!$_SESSION[$name]) $_SESSION[$name] = 1 ;

            $this -> keyvalues[$name] = $_SESSION[$name] ;
        }
    }

    // tables
   
    function formactiontables()
    {
        return $_SERVER[PHP_SELF] ;
    }
   
    function formfieldstables()
    {
        return '<input type="submit" value="table" />';
    }

    // keys
   
    function formactionkeys()
    {
        return $_SERVER[PHP_SELF] . "?search";
    }
   
    function formfieldskeys()
    {
        $s = table2form( $this -> tablename , $this -> keys , $this -> keyvalues ) ;

        $s .= '<input type="submit" value="search" />' ;

        return $s ;
    }
   
    // data
   
    function formactiondata()
    {
        return $_SERVER[PHP_SELF] . "?update" ;
    }

    function formfieldsdata()
    {
        $s = table2form( $this -> tablename , $this -> keys , $this -> keyvalues , true ) ;

        $s .= '<input type="submit" value="update" />' ;

        return $s ;
    }

    // destroy
       
    function formactiondestroy()
    {
        return $_SERVER[PHP_SELF] . "?destroy" ;
    }

    function formfieldsdestroy()
    {
        return '<input type="submit" value="destroy" />' ;
    }

    // update
       
    function formdataupdate()
    {
        return post2update( $this -> tablename , $_POST ) ;
    }

}
?>


REFERRERS
PhpMySqlUnicode

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.1001 seconds