PHP常è§é®é¢_PHP
程序员文章站
2022-06-14 20:23:49
...
1.é
ç½®php.iniï¼ä¿®æ¹session.save_path
å¦ï¼session.save_path = d:/developer/php/temp æ /tmp
2.ç¨åº
1.php
session_start();
$var1 = "test";
session_register("var1");
?>
2.php
session_start();
echo $var1;
?>
é¦å è¿è¡1.phpï¼ç¶åè¿è¡2.phpï¼é¡µé¢åºè¯¥åºç°test
é误æ示ï¼Cannot send session cookie - headers already sent by ...
åºç°è¯¥é误æ¯é¡µé¢ä¸session_start();è¯å¥ååå¨è¾åºè¯å¥
å¦ä¸ä¾ï¼
session_start();
$var1 = "test";
session_register("var1");
?>
å°æ¾å°åé¢å³å¯
ä¿®æ¹php.ini
upload_tmp_dir=d:/temp æ /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;
}
?>
å¦ï¼session.save_path = d:/developer/php/temp æ /tmp
2.ç¨åº
1.php
session_start();
$var1 = "test";
session_register("var1");
?>
2.php
session_start();
echo $var1;
?>
é¦å è¿è¡1.phpï¼ç¶åè¿è¡2.phpï¼é¡µé¢åºè¯¥åºç°test
é误æ示ï¼Cannot send session cookie - headers already sent by ...
åºç°è¯¥é误æ¯é¡µé¢ä¸session_start();è¯å¥ååå¨è¾åºè¯å¥
å¦ä¸ä¾ï¼
session_start();
$var1 = "test";
session_register("var1");
?>
å°æ¾å°åé¢å³å¯
ä¿®æ¹php.ini
upload_tmp_dir=d:/temp æ /tmp
upload.php
====================================
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;
}
?>