Php
/**
- Enable Session/session_start ();
- Contains initialization file /include_once '. /.. /.. /sys/config/db-cred.inc.php ';/*
- Define constants for configuration information /foreach ($C as $name = = $val) {define ($name, $val);} /*
Generate an associative array with the form action key
*/
$actions = Array (
' Event_edit ' = Array (
' Object ' = ' Calendar ',
' Method ' = ' processform ',
' Header ' = ' location: '. /.. /'
),
' User_login ' = Array (
' Object ' = ' Admin ',
' Method ' = ' processloginform ',
' Header ' = ' location: '. /.. /'
)
);
/**
Ensure that the anti-cross-site mark in the session is consistent with the submitted tag and the request is valid.
*/
if ($_post[' token ']==$_session[' token ') &&
Isset ($actions [$_post[' action '])) {
$use _array = $actions [$_post[' action '];
$obj = new $use _array ' object ';
if ( true == $msg=$obj->$use_array['method']() ) { header($use_array['header']); exit;} else { die( $msg );}
} else {
Redirect to Home page if token/action is illegal
Header ("Location:.. /.. /");
Exit
}
function __autoload ($class) {
$filename = "../../../sys/class/class.".$class.".inc.php";if ( file_exists($filename) ) { include_once $filename;}
}
The main problem is this: $obj-$use _array ' method '
As soon as this step comes up, function name must is a string in E:\qampp\htdocs\Source files\public\assets\inc\process.inc.php:40 Stack Trace: #0 {main} thrown in E:\qampp\htdocs\Source files\public\assets\inc\process.inc.php on the line 40 error.
It is possible to call the ProcessForm () or Processloginform () method in the class directly with $obj.
Ask the great God to help see.
Reply content:
Http://blog.sina.com.cn/s/blog_8d7518cb0100zk1t.html