<?php
/* $Id: ConnectDB.inc 3454 2010-05-06 10:13:27Z daintree $*/require_once ($PathPrefix .'includes/MiscFunctions.php');
print(!isset($_SESSION['DatabaseName']));
if (!isset($_SESSION['DatabaseName'])){
if (isset($_POST['CompanyNameField'])){
if (is_dir('companies/' . $_POST['CompanyNameField']) AND $_POST['CompanyNameField'] != '..'){
$_SESSION['DatabaseName'] = $_POST['CompanyNameField'];
include_once ($PathPrefix . 'includes/ConnectDB_' . $dbType . '.inc');
} else {
                       prnMsg(_('The company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is not configured for use with this installation of webERP. Check that a directory named ' . $_POST['CompanyNameField'] . ' is set up under the companies sub-directory.'),'error');
                       prnMsg(_('Check the company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is the same as the database name.'),'error');
prnMsg(_('The company name abbreviation entered at login must also have a company directory defined. See your system administrator'),'error');
    }
} elseif (isset($DatabaseName)) { /* Scripts that do not require a login must have the $DatabaseName variable set in hard code */
$_SESSION['DatabaseName'] = $DatabaseName;
include_once ($PathPrefix . 'includes/ConnectDB_' . $dbType . '.inc');
} elseif ($AllowAnyone) {
    include_once($PathPrefix .'includes/ConnectDB_' . $dbType . '.inc'); /* Fix call to undefined function DB_query in GetConfig.php, line 9 when calling RecurringSalesOrdersProcess.php from Cron */
}
} else {

  include_once($PathPrefix .'includes/ConnectDB_' . $dbType . '.inc');
}
print($_SESSION['DatabaseName'].'...sss');
?>本人不懂php代码,这段代码放在apache服务器下正常,放到iis上面执行好像有问题,不知道是什么问题。

解决方案 »

  1.   

    is_dir 是否目录 是返回trueinclude_once 包含只包含一次(等于引用文件类等)isset是否存在貌似缓存数据结构
      

  2.   

    prnMsg这个应该是提示信息, 看看安装系统错误提示什么
      

  3.   

    require_once('server/os.php');
    $os = new os();----为什么这句会报错呢?
      

  4.   

    是linux下的apache服务器吗?如果是的话你需要查看一下路径信息,$PathPrefix看一下这个变量因为在linux和windows下路径写法是不一样的,无法正确包含文件require_once('server/os.php'),那么$os = new os();自然会报错
      

  5.   

    你文件里有os这个类吗?你就new?