库存管理软件-php-MySQL

库存管理软件-php-MySQL,php,mysql,inventory-management,Php,Mysql,Inventory Management,我发现了一个非常简单的清单PHP脚本,它非常适合我的小学系统。然而,我相信PHP4,现在甚至XAMPP也在继续:) 我不是一个程序员,但如果它容易的话,我渴望修复它。能不能有人给我指点迷津,帮我找到这段代码的补丁 不幸的是,无法联系到所有者。。像往常一样。但它是免费的 我所做的: 下载 运行sql并修复引擎的类型错误(已工作) 将数据库配置为php 首次在浏览器中运行(Chrome) 得到这个: 致命错误:第187行C:\xampp\htdocs\Inventory\lib\site.php

我发现了一个非常简单的清单PHP脚本,它非常适合我的小学系统。然而,我相信PHP4,现在甚至XAMPP也在继续:) 我不是一个程序员,但如果它容易的话,我渴望修复它。能不能有人给我指点迷津,帮我找到这段代码的补丁

不幸的是,无法联系到所有者。。像往常一样。但它是免费的

我所做的:

  • 下载
  • 运行sql并修复引擎的类型错误(已工作)
  • 将数据库配置为php
  • 首次在浏览器中运行(Chrome)
得到这个:

致命错误:第187行C:\xampp\htdocs\Inventory\lib\site.php中的调用时间传递引用已被删除

以下是site.php的代码:

    <?php
$sess_save_path = "./tmp/";
function open ($save_path, $session_name) { 
 global $sess_save_path, $sess_session_name; 

 $sess_save_path = $save_path; 
 $sess_session_name = $session_name; 
 return(true); 
} 

function close() { 
 return(true); 
} 

function read ($id) { 
 global $sess_save_path, $sess_session_name; 

 $sess_file = "$sess_save_path/sess_$id"; 
 if ($fp = @fopen($sess_file, "r")) { 
   $sess_data = @fread($fp, @filesize($sess_file)); 
   return($sess_data); 
 } else { 
   return(""); // Must return "" here. 
 } 

} 

function write ($id, $sess_data) { 
 global $sess_save_path, $sess_session_name; 

 $sess_file = "$sess_save_path/sess_$id"; 
 if ($fp = @fopen($sess_file, "w")) { 
   return(fwrite($fp, $sess_data)); 
 } else { 
   return(false); 
 } 

} 

function destroy ($id) { 
 global $sess_save_path, $sess_session_name; 

 $sess_file = "$sess_save_path/sess_$id"; 
 return(@unlink($sess_file)); 
} 

/********************************************* 
* WARNING - You will need to implement some * 
* sort of garbage collection routine here.  * 
*********************************************/ 
function gc ($maxlifetime) { 
 return true; 
} 

session_set_save_handler ("open", "close", "read", "write", "destroy", "gc"); 

session_start(); 



session_start();

//error_reporting(0);

require_once _LIBPATH . "common.php";
require_once _LIBPATH . "xml.php";
require_once _LIBPATH . "template.php";
require_once _LIBPATH . "config.php";
require_once _LIBPATH . "html.php";
require_once _LIBPATH . "database.php";
require_once _LIBPATH . "vars.php";
require_once _LIBPATH . "menu.php";
require_once _LIBPATH . "library.php";
require_once _LIBPATH . "sqladmin.php";
require_once _LIBPATH . "forms.php";
require_once _LIBPATH . "mail.php";

class CBase {
    /**
    * description
    *
    * @var type
    *
    * @access type
    */
    var $html;

}
class CSite {

    /**
    * description
    *
    * @var type
    *
    * @access type
    */
    var $admin;
    /**
    * description
    *
    * @var type
    *
    * @access type
    */
    var $html;


    /**
    * description
    *
    * @param
    *
    * @return
    *
    * @access
    */
    function CSite($xml , $admin = false) {
        global $_CONF , $base;

        $this->admin = $admin;

        //loading the config
        $tmp_config = new CConfig($xml);

        $_CONF = $tmp_config->vars["config"];

        //loading the templates
        if ($this->admin) {
            if (is_array($_CONF["templates"]["admin"])) {
                foreach ($_CONF["templates"]["admin"] as $key => $val) {
                    if ($key != "path")
                        $this->templates[$key] = new CTemplate($_CONF["templates"]["admin"]["path"] . $_CONF["templates"]["admin"][$key]);
                }           
            }           
        } else {

            if (is_array($_CONF["templates"])) {
                foreach ($_CONF["templates"] as $key => $val) {
                    if (($key != "path" ) && ($key != "admin"))
                        $this->templates[$key] = new CTemplate($_CONF["templates"]["path"] . $_CONF["templates"][$key]);
                }               
            }
        }


        $base = new CBase();
        $base->html = new CHtml();
        $this->html = &$base->html;

        //make a connection to db
        if (is_array($_CONF["database"])) {
            $this->db = new CDatabase($_CONF["database"]);

            //vars only if needed
            if ($_CONF["tables"]["vars"]) {
                $this->vars = new CVars($this->db , $_CONF["tables"]["vars"]);
                $base->vars = &$this->vars;
            }

            $this->tables = &$_CONF["tables"];
        }               

    }

    function TableFiller($item) {
        if (file_exists("pb_tf.php")) {
            include("pb_tf.php");
        }
    }

    /**
    * description
    *
    * @param
    *
    * @return
    *
    * @access
    */
    function Run() {
        global $_TSM;

        if (file_exists("pb_events.php")) {
            include("pb_events.php");

            **$_TSM["PB_EVENTS"] = @DoEvents(&$this);**
        }

        if (is_object($this->templates["layout"])) {
            echo $this->templates["layout"]->Replace($_TSM);
        }       
    }
}


?>
admin=$admin;
//加载配置文件
$tmp_config=new CConfig($xml);
$\u CONF=$tmp\u config->vars[“config”];
//加载模板
如果($this->admin){
if(是_数组($_CONF[“模板”][“管理”])){
foreach($_CONF[“templates”][“admin”]作为$key=>$val){
如果($key!=“path”)
$this->templates[$key]=new-CTemplate($_-CONF[“templates”][“admin”][“path”]。$_-CONF[“templates”][“admin”][$key]);
}           
}           
}否则{
if(是_数组($_CONF[“模板”])){
foreach($_CONF[“模板”]作为$key=>$val){
if(($key!=“path”)&($key!=“admin”))
$this->templates[$key]=new-CTemplate($_-CONF[“templates”][“path”]。$_-CONF[“templates”][$key]);
}               
}
}
$base=新的CBase();
$base->html=new-CHtml();
$this->html=&$base->html;
//连接到数据库
if(是_数组($_CONF[“数据库”])){
$this->db=newCDATA基础($\u CONF[“数据库]);
//只有在需要时才使用VAR
如果($_CONF[“tables”][“vars”]){
$this->vars=new-cvar($this->db,$_-CONF[“tables”][“vars”]);
$base->vars=&$this->vars;
}
$this->tables=&$_CONF[“tables”];
}               
}
功能表填充器($item){
如果(文件_存在(“pb_tf.php”)){
包括(“pb_tf.php”);
}
}
/**
*描述
*
*@param
*
*@返回
*
*@access
*/
函数运行(){
全球美元;
如果(文件_存在(“pb_events.php”)){
包括(“pb_events.php”);
**$\u TSM[“PB_事件”]=@DoEvents(&$this)**
}
如果(是对象($this->templates[“layout”])){
echo$this->templates[“layout”]->Replace($\u TSM);
}       
}
}
?>
如果有人有时间帮助我,请提前向我表示感谢

致命错误:第187行C:\xampp\htdocs\Inventory\lib\site.php中的调用时间传递引用已被删除

该特定的错误消息(其中有187)指的是使用前面有
&
的参数调用函数。该公约不再是该语言的一部分。如果函数本身被定义为通过引用接收参数,它仍然可以工作。您只需从函数调用中删除该字符


你好,非常感谢。就这样。我发现了另外两个相同的问题并已修复。非常感谢。