?????????????PHP?????????е??????10???????????ο???
????1???????????????????
????get??post??session???μ?php?汾????????????????????????????????????????????????$_GET['foo']??$_POST['foo']??$_SESSION['foo']??????????????????????????????(php.ini???register_globals=On);??????????????????????????μ?д?????á?
???????PHP?е????????
??????PHP 4.2.0?????register_globals???????off???????????????????????????????????$PHP_SELF???????趨??SESSION????????????“$??????”?????????????????????????????????????????????????????Щ??????????????PHP?????????????£?
????$_SERVER
??????????Web???????趨?????????????????л?????????????????????$HTTP_SERVER_VARS???顣?????$PHP_SELF???$_SERVER['PHP_SELF']??????????phpinfo???????$_SERVER??????
????$_GET
????????HTTP GET?????????????????????????????$HTTP_GET_VARS???顣
????$_POST
????????HTTP POST?????????????????????????????$HTTP_POST_VARS???顣
????$_COOKIE
????????HTTP Cookies?????????????????????????????$HTTP_COOKIE_VARS???顣
????$_SESSION
??????????????????????????????????$HTTP_SESSION_VARS???顣
????$_FILES
????????HTTP POST?????????????????????????????????$HTTP_POST_FILES???顣
????$_ENV
??????л????????????????????????????$HTTP_ENV_VARS???顣
????????$_FILES??????(?????????“myfile”)
????$_FILES['myfile']['name']
??????????????????????(????·??)??
????$_FILES['myfile']['type']
?????????MIME??????????????????????????????“image/gif”??
????$_FILES['myfile']['size']
???????????????С????λ?????
????$_FILES['myfile']['tmp_name']
????????????????????????????????(????·??)??
????$_FILES['myfile']['error']
???????????????????????['error']????PHP 4.2.0?汾????????
??????php.ini?е?register_globals???????on???$myfile_name?????$_FILES['myfile']['name']??$myfile_type?????$_FILES['myfile']['type']???
????2??win32?μ?session????????????
????php.ini????session.save_path=/tmp
???????????linux?μ??????win32??php?????дsession???????session?????????????????·?????????????session.save_path=c:windows emp??
????3????????????
??????php.ini??display_errors=On????error_reporting=E_ALL???????????е?????????????????????????????????????phpд?????????????????δ?????????????????????????????????????????????????Σ????????$foo??????if(isset($foo))echo$foo????echo@$foo
????4??header already sent
???????????????????????HEADER???????????????????????1?????????HEADER?PRING????ECHO??2.??????????п???3.?????INCLUDE???????????????β???п??л???????????????????
????5??????php.ini????б仯
???????????web server??????IIS??Apache?????????????μ????á?
????6???????sql????????????????????????????????????echo???sql??????????????????????
????7??include??require??????

???????????????????????????????????????include???notice???????????????????require??????????????????????????win32????????????????????У???????????????ò??????include??require???????????????????????*nux????????????????????????????????????????ο??????include_once??require_once##?????д??????????
????function r($file_name){
????$filenum=@fopen($file_name??"r");
????@flock($filenum??LOCK_SH);
????$file_data=@fread($filenum??filesize($file_name));
????@fclose($filenum);
????return$file_data;
????}
????function w($file_name??$data??$method="w"){
????$filenum=@fopen($file_name??$method);
????flock($filenum??LOCK_EX);
????$file_data=fwrite($filenum??$data);
????fclose($filenum);
????return$file_data;
????}
????8??isset??empty??????
?????????????????????????isset??????????????????empty??????????????????????????????????????????????????php?????????????????notice????????????????????????$foo=”"????$foo=0????$foo=false?????empty($foo)?????棬isset($foo)??????棬???????????????????????????????????????????unset($foo)????$foo=NULL??
????9??mysql??????????й????
????php???mysql??????????mysql???????????????й???????????????д????????????order????????????????????sql????????????????????`[tab??????]??????????????select*from`order`??
????10?????HTTPЭ???????????????????
???????????·??????????????????????????????????????
????1.??form???????????????????????????????????????£?
????<form action=""method="post">
????<input name="usefile"type="file">
????</form>
????????????????????????2???
????echo"<pre>";
????print_r($_FILES);
????echo"</pre>";
????2.??form?????????????????????????????£?
????<form action=""method="post">
????<input name="usefile_a"type="file">
????<input name="usefile_b"type="file">
????<input name="usefile_c"type="file">
????</form>
???????????????????????
????echo"<pre>";
????print_r($_FILES);
????echo"</pre>";