国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? PHP ???? ??? ???? PHP ??? ?? ???

??? ???? PHP ??? ?? ???

Jul 25, 2016 am 08:43 AM

  1. class FileUpload {
  2. private $filepath; //???? ??? ??? ?? ??
  3. private $allowtype=array('gif', 'jpg', ' png' , 'jpeg'); //???? ???? ?? ??
  4. private $maxsize=1000000; //???? ???? ?? ?? ??? 1M???.
  5. private $israndname=true; ??? ??? ??? ??? false? ????. ?? ?? ??? ?????
  6. private $originName; //?? ?? ??
  7. private $tmpFileName; //?? ?? ??
  8. private $fileType;
  9. private $fileSize; //?? ??
  10. private $newFileName; //? ?? ??
  11. private $errorNum=0; //?? ??
  12. private $errorMess=""; ?? ??? ??
  13. / /???? ??? ????? ? ?????
  14. //1. ??? ?? ??, 2. ?? ??, 3. ?? ??, 4. ??? ?? ?? ?? ??
  15. / /???? ?? ?? ????? ??? ??? ????, ?? ? ?? ????? ?? ?? ???? ?? ?? ????? ?? ?? ?????.
  16. function __construct($options=array()){
  17. foreach($ options as $key=>$val){
  18. $key=strtolower($key);
  19. //??? ???? ??? ??? ??? ?? ??? ???? ??
  20. if(!in_array($key,get_class_vars(get_class($this)))){
  21. ??;
  22. }
  23. $this->setOption($key, $val);
  24. }
  25. }
  26. ??? ?? getError(){
  27. $str=" ?? ??? ? ??? ?????? {$this->originName}: ";
  28. switch($this->errorNum){
  29. ?? 4: $ str .= "??? ????? ?????."; break;
  30. ?? 3: $str .= "??? ?????? ????????."; ;
  31. case 2: $str .= "???? ??? MAX_FILE_SIZE ??? ??? ?? HTML ?? ??? ?????.";
  32. case 1: $str .= "???? ??? ?? ?? ?????. php.ini? upload_max_filesize ??"; break;
  33. case -1: $str .= "?? ?? Xu ??"; break;
  34. case -2: $str .= "??? ?? ???. , ???? ??? {$this->maxSize}???? ??? ? ????."; break;
  35. case -3: $ str .= "??? ??"; break;
  36. case -4: $str .= "??????. ???? ??? ??? ????? ????? ??? ????? ?? ?????."; break;
  37. case -5: $str .= " ???? ??? ??? ???? ???."; break;
  38. ???: $str .= "? ? ?? ??";
  39. }
  40. return $str.'
    ';
  41. }
  42. //?? ??? ??? ???? ? ?????
  43. ??? ?? checkFilePath( ){
  44. if(empty($this->filepath)) {
  45. $this->setOption('errorNum', -5) ;
  46. return false;
  47. }
  48. if (!file_exists($this->filepath) || !is_writable($this->filepath)){
  49. if(!@mkdir($ this->filepath, 0755)){
  50. $this ->setOption('errorNum', -4);
  51. return false;
  52. }
  53. }
  54. return true;
  55. }
  56. //?? ??? ??? ???? ? ?????.
  57. ??? ?? checkFileSize() {
  58. if($this->fileSize > $this->maxsize){
  59. $this- >setOPtion('errorNum', '-2');
  60. return false;
  61. }else{
  62. return true;
  63. }
  64. }
  65. //?? ??? ??? ??? ??
  66. ??? ?? checkFileType() {
  67. if (in_array(strtolower($this->fileType), $this->allowtype)) {
  68. return true;
  69. }else{
  70. $this->setOption('errorNum', -1 );
  71. return false;
  72. }
  73. }
  74. //???? ?? ?? ??
  75. ??? ?? setNewFileName(){
  76. if($this->israndname){
  77. $this->setOption('newFileName', $this->proRandName());
  78. } else {
  79. $this-> ;setOption('newFileName', $this->originName);
  80. }
  81. }
  82. //??? ?? ?? ??
  83. ??? ?? proRandName(){
  84. $fileName= date("YmdHis").rand(100,999);
  85. return $fileName.'.'.$this->fileType;
  86. }
  87. ??? ?? setOption($key, $val){
  88. $this->$key=$val;
  89. }
  90. //?? ???? ??
  91. function uploadFile($fileField){
  92. $return=true;
  93. //?? ??? ?? ??
  94. if(!$this-> checkFilePath()){
  95. $this->errorMess=$this->getError();
  96. false ??;
  97. }
  98. $name=$_FILES[$fileField]['name' ];
  99. $tmp_name=$_FILES[$fileField]['tmp_name'];
  100. $size=$_FILES[$fileField]['size' ];
  101. $error=$_FILES[$fileField] ['??'];
  102. if(is_Array($name)){
  103. $errors=array();
  104. for($i= 0; $iif($this->setFiles($name[$i], $tmp_name[$i], $size[$i], $error [$i])){
  105. if(!$ this->checkFileSize() || !$this->checkFileType()){
  106. $errors[]=$this->getError() ;
  107. $return=false;
  108. }
  109. }else{
  110. $error[]=$this->getError();
  111. $return=false;
  112. }
  113. if(!$return)
  114. $this-> ;setFiles();
  115. }
  116. if($return){
  117. $fileNames=array();
  118. for($i= 0; $iif($this->setFiles($name[$i], $tmp_name[$i], $size[$i], $error [$i])){
  119. $this-> ;setNewFileName();
  120. if(!$this->copyFile()){
  121. $errors=$this->getError()
  122. $return=false;
  123. }else{
  124. $fileNames[]=$this->newFileName;
  125. }
  126. }
  127. }
  128. $this->newFileName =$fileNames;
  129. }
  130. $this->errorMess=$errors;
  131. return $return;
  132. } else {
  133. if($this->setFiles($name, $tmp_name, $size, $error) ){
  134. if($this->checkFileSize() && $this->checkFileType()){
  135. $this->setNewFileName();
  136. if($this->copyFile( )){
  137. true? ??;
  138. }else{
  139. $return=false;
  140. }
  141. }else{
  142. $return=false;
  143. }
  144. }else {
  145. $return=false;
  146. }
  147. if(!$return)
  148. $this->errorMess=$this->getError();
  149. return $return;
  150. }
  151. }
  152. ??? ?? copyFile(){
  153. if(!$this->errorNum){
  154. $filepath=rtrim($this->filepath, '/').' /';
  155. $filepath.=$this->newFileName;
  156. if(@move_uploaded_file($this->tmpFileName, $filepath)) {
  157. return true;
  158. }else{
  159. $this->setOption('errorNum', -3);
  160. false ??;
  161. }
  162. }else{
  163. false ??;
  164. }
  165. }
  166. //設(shè)置? $_FILES?? ??? ??? ????
  167. ??? ?? setFiles($name="", $tmp_name='', $size=0, $error=0){
  168. $this->setOption(' errorNum', $error);
  169. if($error){
  170. return false;
  171. }
  172. $this->setOption('originName', $name);
  173. $this- >setOption('tmpFileName', $tmp_name);
  174. $arrStr=explode('.', $name);
  175. $this->setOption('fileType', strtolower($arrStr[count($ arrStr)-1]));
  176. $this->setOption('fileSize', $size);
  177. return true;
  178. }
  179. //于獲取上傳后文件文件名
  180. function getNewFileName(){
  181. return $this->newFileName;
  182. }
  183. //上傳如果失敗,則調(diào)用這個(gè)方法,就可以查看錯(cuò)誤報(bào)告
  184. function getErrorMsg() {
  185. return $this->errorMess;
  186. }
  187. }
復(fù)system代碼
裝好, 上傳文件, php


? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
PHP ?? ??? ??????? PHP ?? ??? ??????? Jul 17, 2025 am 04:16 AM

PHP ?? ??? ?? ???? ?? ? ????? ??? ?????. 1. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

PHP?? ?? ???? ???? ???? ??? ?????? PHP?? ?? ???? ???? ???? ??? ?????? Jul 08, 2025 am 02:37 AM

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP?? ?? ?? PHP?? ?? ?? Jul 18, 2025 am 04:57 AM

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

PHP?? ???? ??? ?????? PHP?? ???? ??? ?????? Jul 11, 2025 am 03:12 AM

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

PHP ?? ?? ? PHP ?? ?? ? Jul 18, 2025 am 04:51 AM

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

?? PHP : ??? ??? ?? PHP : ??? ??? Jul 18, 2025 am 04:54 AM

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled

PHP?? ??? ? ???? ??? ????? ?? PHP?? ??? ? ???? ??? ????? ?? Jul 12, 2025 am 03:15 AM

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.

?? PHP ?? ??? ?? PHP ?? ??? Jul 18, 2025 am 04:52 AM

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2

See all articles