Several common problems. 1. configure php. ini and modify session. save_path, for example, session. save_pathd: prepare phptemp or tmp2. program 1.php? Session_start (); $ var1test; session_register (var1 );? 2. ph 1. configure php. ini and modify session. save_path
For example: session. save_path = d:/developer/php/temp or/tmp
2. program
1. php
Session_start ();
$ Var1 = "test ";
Session_register ("var1 ");
?>
2. php
Session_start ();
Echo $ var1;
?>
First run 1.php and then run 2.php. the page displays test
Session "headers already sent" error
Error message: Cannot send session cookie-headers already sent...
This error occurs when session_start (); an output statement exists before the statement.
For example:
Session_start ();
$ Var1 = "test ";
Session_register ("var1 ");
?>
SetJust move it to the back
File Upload
Modify php. ini
Upload_tmp_dir = d:/temp or/tmp
Upload. php
==========================================
PHP Upload
If ($ upload ){
$ Real_path = $ userfile_name;
If (file_exists ($ real_path )){
Unlink ($ real_path );
}
If (! @ Copy ($ userfile, $ real_path ))
$ Upload_flag = false;
Else
$ Upload_flag = true;
}
?>
Example: session. save_path = d:/developer/php/temp or/tmp 2. program 1.php? Session_start (); $ var1 = "test"; session_register ("var1 ");? 2. ph...