require_once显示致命错误和警告的功能


require_once function showing fatal error and warning

你好,我正在使用PHP,我想将我的类文件夹中的类.php文件包含在我的一个页面中,但它显示错误:

警告: require_once(/usr/home/shantak5/public_html/gman/classes/globalProgram.class.php) [函数.要求一次]:无法打开流:没有这样的文件或 目录 /usr/home/shantak5/public_html/gman/adminGlobalProgram.php 在第 18 行

致命错误:require_once() [函数要求]:打开失败 必填 '/usr/home/shantak5/public_html/gman/classes/globalProgram.class.php' (include_path='/usr/home/shantak5/public_html/gman/PEAR') in /usr/home/shantak5/public_html/gman/adminGlobalProgram.php 在第 18 行

我无法知道我的 code.my .class.php文件在"类"文件夹中有什么问题。

这是我的 adminglobalprogram 的 php 代码.php我在其中添加了 require once 函数:

<?php
require 'config.inc.php';
error_reporting(E_ALL);
if(!$_SESSION['isLogged'])
header("Location: index.php");
if(isset($_GET['hid']) && $_GET['hid'] == 1){
$show = "yes";
}else{
    $show = "no";
}
if(isset($_GET['mod'])){
$update = "yes";
$itemId = $_GET['mod'];
}else{
    $update = "no";
}
require_once(APP_CLASS_PATH."globalProgram.class.php");
$objForm            = new pevcProgram;
$message = "";

if(isset($_POST['saveProgram'])){
                $timeval = mysql_real_escape_string($_POST['timeval']);
                $timeheading = mysql_real_escape_string($_POST['timeheading']);
                $descriptionheading = mysql_real_escape_string($_POST['descriptionheading']);
                $description = mysql_real_escape_string($_POST['description']);
                $description=stripslashes($description);
                $descriptionheading1 = mysql_real_escape_string($_POST['descriptionheading1']);
                $description1 = mysql_real_escape_string($_POST['description1']);
                $description1=stripslashes($description1);
                $descriptionheading2 = mysql_real_escape_string($_POST['descriptionheading2']);
                $description2 = mysql_real_escape_string($_POST['description2']);
                $description2 =stripslashes($description2);
                $descriptionheading3 = mysql_real_escape_string($_POST['descriptionheading3']);
                $description3 = mysql_real_escape_string($_POST['description3']);
                $description3 =stripslashes($description3);
                $image = $_FILES['image']['name']; 
                if($flag !== 0){                
                if(!empty($image)){
                $bgSource   = $_FILES['image']['tmp_name'];
                $ext = strtolower(substr(strrchr($image, "."), 1));
                if($ext == "png" || $ext == "jpg" || $ext == "jpeg" ){
                /* Open This code
                $imgpathD   = 'photos/'.topBarBgtest.".$ext";
                $imgpath    = './photos/'.topBarBgtest.".$ext";
                */
                $imgpathD   = 'photos/program/'.'Global_'.$image;
                $imgpath    = './photos/program/'.'Global_'.$image;
                if(move_uploaded_file($bgSource, $imgpath)){
                //$message .= "Image successfully uploaded.<br />";
                }else{
                $flag = 0;
                }
                }else{
                $flag = 0;
                }
                }
                }
                //$content = mysql_real_escape_string($_POST['FCKeditor1']);
                $line = $_POST['line'];
                $srorder = $_POST['srorder'];
                $status = $_POST['status'];
                $fieldInfo  = array(
                                         'timeval'      => $timeval,
                                         'timeheading'  => $timeheading,
                                         'descriptionheading'=>$descriptionheading,
                                         'description'   => $description,
                                         'descriptionheading1'=>$descriptionheading1,
                                         'description1'   => $description1,
                                         'descriptionheading2'=>$descriptionheading2,
                                         'description2'   => $description2,
                                         'descriptionheading3'=>$descriptionheading3,
                                         'description3'   => $description3,
                                         'image'           => $image,
                                         'line'         => $line,
                                         'srorder'      => $srorder,
                                         'status'       => $status);
                $recId      = $objForm->addFormField($fieldInfo);
                if(isset($recId) && $recId != ""){                  
                $message .= "Form successfully saved!!.<br />";
                }else{
                $message .= "Error!Form data not saved.Please try again!!.<br />";
                }
                }
if(isset($_POST['update']))
          {
                //$content = mysql_real_escape_string($_POST['FCKeditor1']);
                $timeval = mysql_real_escape_string($_POST['timeval']);
                $timeheading = mysql_real_escape_string($_POST['timeheading']);
                $descriptionheading = mysql_real_escape_string($_POST['descriptionheading']);
                $description = mysql_real_escape_string($_POST['description']);
                $description=stripslashes($description);
                $line = $_POST['line'];
                $descriptionheading1 = mysql_real_escape_string($_POST['descriptionheading1']);
                $description1 = mysql_real_escape_string($_POST['description1']);
                $description1 =stripslashes($description1);
                $descriptionheading2 = mysql_real_escape_string($_POST['descriptionheading2']);
                $description2 = mysql_real_escape_string($_POST['description2']);
                $description2 =stripslashes($description2);
                $descriptionheading3 = mysql_real_escape_string($_POST['descriptionheading3']);
                $description3 = mysql_real_escape_string($_POST['description3']);
                $description3 =stripslashes($description3);
                //image uploade//   
                $image = $_FILES['image']['name']; 
                if($flag !== 0){                
                if(!empty($image)){
                $bgSource   = $_FILES['image']['tmp_name'];
                $ext = strtolower(substr(strrchr($image, "."), 1));
                if($ext == "png" || $ext == "jpg" || $ext == "jpeg" ){
                /* Open This code
                $imgpathD   = 'photos/'.topBarBgtest.".$ext";
                $imgpath    = './photos/'.topBarBgtest.".$ext";
                */
                $imgpathD   = 'photos/program/'.'Global_'.$image;
                $imgpath    = './photos/program/'.'Global_'.$image;
                if(move_uploaded_file($bgSource, $imgpath)){
                //$message .= "Image successfully uploaded.<br />";
                }else{
                $flag = 0;
                }
                }else{
                $flag = 0;
                }
                }
                }
                $srorder = $_POST['srorder'];
                $status = $_POST['status'];
                $updId = $_POST['updId'];
                $fieldInfo      = array('timeval'   => $timeval,
                                        'timeheading'   => $timeheading,
                                        'descriptionheading'=>$descriptionheading,
                                        'description'   => $description,
                                        'descriptionheading1'=>$descriptionheading1,
                                        'description1'   => $description1,
                                        'descriptionheading2'=>$descriptionheading2,
                                        'description2'   => $description2,
                                        'descriptionheading3'=>$descriptionheading3,
                                        'description3'   => $description3,
                                        'image'           => $image,
                                         'line'     => $line,
                                         'srorder'  => $srorder,
                                         'status'   => $status);
                $recId      = $objForm->updateFormInfo($updId,$fieldInfo);
                if(isset($recId) && $recId != "")
                {                   
                $message .= "Form successfully updated!!.<br />";
                }else
                {
                $message .= "Error!Form data not updated.Please try again!!.<br />";
                }
            }
                /*unset($_GET['update']);*/
/* srorder update accroding text input*/    

if(isset($_POST['textsubmit']))
          {
                //$content = mysql_real_escape_string($_POST['FCKeditor1']);
                $timeval = mysql_real_escape_string($_POST['timeval']);
                $timeheading = mysql_real_escape_string($_POST['timeheading']);
                $descriptionheading = mysql_real_escape_string($_POST['descriptionheading']);
                $description = mysql_real_escape_string($_POST['description']);
                $description=stripslashes($description);
                $descriptionheading1 = mysql_real_escape_string($_POST['descriptionheading1']);
                $description1 = mysql_real_escape_string($_POST['description1']);
                $description1 =stripslashes($description1);
                $descriptionheading2 = mysql_real_escape_string($_POST['descriptionheading2']);
                $description2 = mysql_real_escape_string($_POST['description2']);
                $description2 =stripslashes($description2);
                $descriptionheading3 = mysql_real_escape_string($_POST['descriptionheading3']);
                $description3 = mysql_real_escape_string($_POST['description3']);
                $description3 =stripslashes($description3);
                //image uploade//   
                $image = $_FILES['image']['name']; 
                if($flag !== 0){                
                if(!empty($image)){
                $bgSource   = $_FILES['image']['tmp_name'];
                $ext = strtolower(substr(strrchr($image, "."), 1));
                if($ext == "png" || $ext == "jpg" || $ext == "jpeg" ){
                /* Open This code
                $imgpathD   = 'photos/'.topBarBgtest.".$ext";
                $imgpath    = './photos/'.topBarBgtest.".$ext";
                */
                $imgpathD   = 'photos/program/'.'Global_'.$image;
                $imgpath    = './photos/program/'.'Global_'.$image;
                if(move_uploaded_file($bgSource, $imgpath)){
                //$message .= "Image successfully uploaded.<br />";
                }else{
                $flag = 0;
                }
                }else{
                $flag = 0;
                }
                }
                }
                $line = $_POST['line'];
                $srorder = $_POST['srorder'];
                $status = $_POST['status'];
                $updId = $_POST['updId'];
                $fieldInfo      = array('timeval'   => $timeval,
                                        'timeheading'   => $timeheading,
                                        'descriptionheading'=>$descriptionheading,
                                        'description'   => $description,
                                        'descriptionheading1'=>$descriptionheading1,
                                        'description1'   => $description1,
                                        'descriptionheading2'=>$descriptionheading2,
                                        'description2'   => $description2,
                                        'descriptionheading3'=>$descriptionheading3,
                                        'description3'   => $description3,
                                        'image'           => $image,
                                         'line'     => $line,
                                         'srorder'  => $srorder,
                                         'status'   => $status);
                $recId      = $objForm->updateFormInfo($updId,$fieldInfo);
                if(isset($recId) && $recId != "")
                {                   
                $message .= "Form successfully updated!!.<br />";
                }else
                {
                $message .= "Error!Form data not updated.Please try again!!.<br />";
                }
            }


if(isset($_GET['Rmod'])){
$itemId = $_GET['Rmod'];        
$formretu   = $objForm->deleteRec($itemId);
if($formretu){
$message .= "Record successfully Deleted!!.<br />"; 
    }else{
    $message .= "Record not Deleted!!.<br />";  
        }
}       

if($update == "yes"){
$formArr    = $objForm->getFormInfo($itemId);               
$timeval    = $formArr->timeval;
//$content      = $formArr->content;
//$content = stripslashes($content);
$timeheading            = $formArr->timeheading;
$descriptionheading     = $formArr->descriptionheading;
$description            = $formArr->description;
$descriptionheading1    = $formArr->descriptionheading1;
$description1           = $formArr->description1;
$descriptionheading2    = $formArr->descriptionheading2;
$description2           = $formArr->description2;
$descriptionheading3    = $formArr->descriptionheading3;
$description3           = $formArr->description3;
$image                  = $formArr->image;
$line                   = $formArr->line;
$srorder                = $formArr->srorder;
$status                 = $formArr->status;
}
$asiaArr        = $objForm->getAllAsiaProg1();
$upNUM      = $objForm->isRecord();
$upNUM      = $upNUM;
$recNum     = $objForm->isRecord();     
$recNum = $recNum + 1;
//print_r($_SESSION); 
$smarty->assign('show', $show);
$smarty->assign('update', $update);
$smarty->assign('timeval', $timeval);
$smarty->assign('timeheading', $timeheading);
$smarty->assign('descriptionheading', $descriptionheading);
$smarty->assign('description', $description);
$smarty->assign('descriptionheading1', $descriptionheading1);
$smarty->assign('description1', $description1);
$smarty->assign('descriptionheading2', $descriptionheading2);
$smarty->assign('description2', $description2);
$smarty->assign('descriptionheading3', $descriptionheading3);
$smarty->assign('description3', $description3);
$smarty->assign('image', $image);
//$smarty->assign('content', $content);
$smarty->assign('line', $line);
$smarty->assign('srorder', $srorder);
$smarty->assign('status', $status);
$smarty->assign('asiaArr', $asiaArr);
$smarty->assign('itemId', $itemId);
$smarty->assign('upNUM', $upNUM);
$smarty->assign('recNum', $recNum);
//$smarty->assign('content', $newContent);
$smarty->assign('message', $message);
//$smarty->assign('sno', $sno);
$smarty->display('adminGlobalProgram.tpl');
?>
不是

那么简单吗?

/usr/home/shantak5/public_html/gman/classes/globalProgram.class.php

此文件: globalProgram.class.php 这里不存在:/usr/home/shantak5/public_html/gman/classes/

此错误仅在以下情况下发生:

1) 您的文件未位于定义的位置。

2)上述文件与定位之间存在名称冲突 文件。

3) 文件中有任何区分大小写的字母。

请在您的情况下检查以上内容