Session ,__ autoload (), problem. Learn from others. -. -After I start a session, I want to set the validity period of the session. how can I set it! I changed session. cache_expire1 in the PHP. ini configuration file, but the session. gc_maxlifetime10 was not implemented. Ask for advice -. -! And ....... Session ,__ autoload (), problem. Learn from others. -. -
After I start a session, I want to set the validity period of the session. how can I set it! I changed session. cache_expire = 1 in the PHP. ini configuration file, but the session. gc_maxlifetime = 10 was not implemented. Ask for advice -. -!
And .......
Php file loading _ autoload ($ class_name ){
}
I used autoload () in the first file to introduce other files. this method is also used in the second file. Then I instantiate two classes in three files. Err: Cannot redeclare _ autoload () (previusly declared in C: \ AppServ \ www \ test \ autoload_test.php: 1) in C: \ AppServ \ www \ test \ include1.php on line 4
Concise Code:
File 1:
Function _ autoload ($ class_name ){
Include $ class_name. ". php ";
}
Class include1 {}
?>
File 2:
Function _ autoload ($ class_name ){
Include $ class_name. ". php ";
}
Class include2 {}
?>
File 3:
Include $ class_name. ". php ";
}
$ Inculde1 = new include1 ();
$ Inculde2 = new include2 ();
?>
Please advise.
------ Solution --------------------
The second problem is that you have already declared this function in the third file, so you no longer need to become famous again.
------ Solution --------------------
Session_cache_expire (1); make sure it is placed before session_start ()