मुझे एक त्रुटि मिल रही है, मुझे नहीं पता कि मुझे कैसे ठीक करना है, इसलिए मुझे आश्चर्य है कि मुझे कुछ मदद मिल सकती है या नहीं।PHP अधिसूचना एक अपूर्ण वस्तु
यह त्रुटि
Fatal error: process_form() [<a href='function.process-form'>function.process-form</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Template" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/twinmeddev/html/template_add.php on line 44
मैं process_form() फ़ंक्शन में यह त्रुटि प्राप्त है। तो मैं इससे क्या प्राप्त करता हूं कि, इसकी सोच मैंने टेम्पलेट के लिए कक्षा को लोड नहीं किया है। वास्तव में मैं शीर्ष पर किया था। 'Inc/item.class.php' शामिल है; क्या मुझे इसे फ़ंक्शन में फिर से शामिल करना है?
त्रुटि के साथ विशेष पृष्ठ के लिए कोड यहां दिया गया है। आप देख सकते हैं कि मेरे पास सबकुछ शामिल होना चाहिए जैसा कि होना चाहिए। मैं कहाँ पर गलत हो गया?
<?php
include 'inc/prep.php';
include 'inc/header.class.php';
include 'inc/item.class.php';
include 'inc/template.class.php';
include 'inc/formhelper.class.php';
include 'inc/formvalidator.class.php';
include_once('inc/config/config.php') ;
include_once('inc/DBE.class.php') ;
include_once('inc/GenFuncs.php') ;
include_once('inc/Search.class.php') ;
session_start();
//Verify that user is logged in.
VerifyLogin($_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']);
if(array_key_exists('_submit',$_POST)) {
if($fv_errors = validate_form()) {
show_form($fv_errors);
} else {
process_form();
}
}
else {
// The form wasn't submitted or preview was selected, so display
show_form();
}
function validate_form(){
}
function process_form(){
global $mysqli;
echo var_dump($_SESSION);
$Template = $_SESSION['template'];
$Template->name = $_POST['name'];
$Template->descript = $_POST['descript'];
$Template->user = $_SESSION['User'];
$Template->customer = $_SESSION['CustID'];
$Template->status = $_POST['status'];
$Template->insert();
//header("Location: template.php");
}
अपने php.ini फ़ाइल session.auto_start के लिए सेटिंग क्या है? –