簡體   English   中英

庫存管理軟件-PHP MySQL

[英]Inventory Management Software - php MySQL

我發現了一個非常簡單的清單PHP腳本,非常適合我的小學系統。 但是,我相信PHP 4,現在甚至XAMPP都在繼續發展:)我不是程序員,但是渴望在容易的情況下對其進行修復。 Coudl有人給我指導,以查找此小代碼的修補程序。

不幸的是,所有者不能像往常一樣聯系。 但這是免費的http://inventory-management.org/

我做了什么:

  • 已下載
  • 運行sql並將TYPE錯誤修復為Engine(有效)
  • 配置數據庫到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);
        }       
    }
}


?>

如果有人有時間幫助我,請先感謝。

致命錯誤:187行的C:\\ xampp \\ htdocs \\ Inventory \\ lib \\ site.php中的調用時傳遞引用已被刪除

該特定錯誤消息(無論在哪里都是187)是指調用帶有&開頭的參數的函數。 該約定不再是該語言的一部分。 如果將函數本身定義為通過引用接收自變量,它將仍然有效。 您只需要從函數調用中刪除該字符。

請參閱有關此主題的手冊。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM