Several common questions_PHP tutorial

WBOY
Release: 2016-07-13 10:53:13
Original
881 people have browsed it

1. Configure php.ini and modify session.save_path
such as: 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, then run 2.php, the page should have test
session "headers already sent" error
Error prompt: Cannot send session cookie - headers already sent by ...
This error occurs because there is an output statement before the session_start(); statement in the page
as follows:

session_start();
$var1 = "test";
session_register("var1");
?>



Put to the back to finish
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;
}
? >














www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632408.htmlTechArticle1. Configure php.ini and modify session.save_path such as: session.save_path = d:/developer/php/ temp or /tmp 2. Program 1.php ? session_start(); $var1 = "test"; session_register("var1"); ? 2.ph...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template