2014-02-17 2 views
0

초등 학교 시스템에 잘 맞는 매우 간단한 인벤토리 PHP 스크립트를 발견했습니다. 그러나 그것은 PHP 4를 믿고 심지어 XAMPP도 옮겼습니다. 저는 프로그래머가 아니지만 쉽게 수정할 수 있으면 열심입니다. Coudl 누군가 나에게이 멋진 코드에 대한 해결책을 찾기 위해 나를 안내해 준다.인벤토리 관리 소프트웨어 - php mysql

불행히도 소유자는 평소와 접촉 할 수 없습니다. 그러나 무료 http://inventory-management.org/

내가 무슨 짓을 :

  • 실행 SQL을 다운로드하고 엔진에 TYPE 오류를 수정
  • 실행 첫
  • 는 PHP로 DB를 구성 (일) 브라우저 (Chrome) 시간대

이 항목의 내용은 다음과 같습니다.

치명적인 오류 : \ XAMPP \ htdocs를 \ 재고 \ LIB \ site.php 여기

라인 187은 site.php의 코드 :

유도 시간 통과하여 참조 C로 제거한
<?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 인) 특정 에러 메시지 & 선행 파라미터로하는 함수를 호출 참조하는

답변

0

Fatal error: Call-time pass-by-reference has been removed in C:\xampp\htdocs\Inventory\lib\site.php on line 187

. 그 대회는 더 이상 언어의 일부가 아닙니다. 함수 자체가 참조로 인수를 받도록 정의 된 경우 함수 자체가 계속 작동합니다. 함수 호출에서 해당 문자를 제거하기 만하면됩니다.

See the manual on this topic.

+0

안녕하십니까. 나는 다른 2 개의 동일한 문제점을 발견하고 고쳤다. 정말 감사합니다. – user3319377