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

? ??? ?? PHP ???? PHP ?? ???, ???? ? ?? ??

PHP ?? ???, ???? ? ?? ??

Jan 06, 2017 pm 02:57 PM

PHP ?? ???, ????, ?? ??? ???? ??? ??? ???, ???? ??? ??? ????

1. ?? ???

1. ?? ??? ??? ????.
div1

2. ??? ??? ??? ????.
div2

3. ??

4. ?? ?? ??? ??
$_FILE[name]? ???? ??

5. ???? ??? ??? ??? ?????.

??? ??? ????.
1) ???? ??? php.ini? upload_max_filesize ??? ?? ???? ?? ?????
2). HTML ??? MAX_FILE_SIZE ??? ??? ?
3) ??? ??? ????????.
4) ???? ??? ????
5) ??? ????. ?? ??

6. ???? ??? ?? ???? ??? ?? ???? ??

? move_uploaded_file ??? ?????
4, 5, 6??? ??? ??? ?? ??? ? ????.
??: ?? ??? ???? PHP ??? ???? ?? ?? ?? ???? html? ? ??? .php

2. ?? ????


1. ?? ??? ??? ??

2. ??? ?? ??? ?? ?? ??? ??? ?????.

3. ?? ?? ?? ???? ?????? ?? ?????


????? ?? ? ??? ??? ????.

//1.重設(shè)響應(yīng)類型
$info = getimagesize($rootPath.$file);
header("Content-Type:".$info['mime']);
//2.執(zhí)行下載的文件名
header("Content-Disposition:attachment;filename=".$file);
//3.指定文件大小
header("Content-Length:".filesize($rootPath.$file));
//4.響應(yīng)內(nèi)容
readfile($rootPath.$file);

3. ?? ??


1. ?? ??? ???

2. ??? ?? ??? ?? ? ??? ??? ?????.

3. ??? ????? ?? ?? ??? ?????

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

??? ??? ????.

PHP ?? ???, ???? ? ?? ??

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

html+php ????:

<!-- 選擇上傳文件區(qū)域-->
<div id="div1">
  <form action="upLoadFile.php" method="post" enctype="multipart/form-data">
    <div id="div2"><input type="text" id="show" /></div>
    <div id="div3">
      <span class="text">選擇文件</span>
       <input type=&#39;hidden&#39; name=&#39;MAX_FILE_SIZE&#39; value=&#39;100000000&#39;> <!--表單上傳文件的大小限制<100M,也可以設(shè)置其它值-->
      <input type="file" id="upfile" name="file" />
    </div>
    <input type="submit" value="上傳" class="upload" />
  </form>
</div>
<!-- 選擇上傳文件區(qū)域結(jié)束-->
 
<!-- 上傳文件顯示區(qū)域-->
<div id="show-file">
  <ul id="ul-list">
    <!-- 內(nèi)嵌php代碼,為了動態(tài)顯示上傳的文件-->
    <?php
    //1.打開目錄
    $dir = opendir(&#39;upload&#39;);
    //2.遍歷目錄
    $i = 0;
    while($file = readdir($dir))
    {
      if($file == &#39;.&#39;||$file == &#39;..&#39;)
        continue;
      echo "<li><img  src="/static/imghw/default1.png"  data-src="move.js"  class="lazy"  src=&#39;upload/{$file}&#39;    style="max-width:90%"PHP ?? ???, ???? ? ?? ??" >
        <div><a href=&#39;deleteFile.php?name={$file}&#39;>刪除</a></span></div>
        <span><a href=&#39;download.php?name={$file}&#39;>下載</a></span></li>";
    }
    //3.關(guān)閉目錄
    closedir($dir);
    ?>
    <!-- 內(nèi)嵌php代碼結(jié)束-->
  </ul>
</div>
<!-- 上傳文件顯示區(qū)域結(jié)束-->
css ??:

*{margin:0;padding:0;}
    ul,li{list-style: none;}
    /*最外層的div,目的是包住選擇文件按鈕,顯示框和上傳文件按鈕*/
    #div1{width:405px;height:38px;position: relative;margin:40px auto;}
 
    /*第二層div包住顯示框和上傳按鈕,右浮動*/
    #div2{float: right;}
    #div2 input {width:250px;height: 38px;font-size: 22px;}
 
    /*第三層div包住input file*/
    #div3{float:left;width:140px;height:38px;position: relative;
      background: url("upload.jpg") no-repeat 0 0;margin-left: 5px;}
    #div3 input{position: absolute;width:100%;height: 100%;top:0;left: 0;
      z-index: 1;opacity:0;}
 
    /*圖片(選擇文件按鈕)上的文字*/
    .text{display: block;width:140px;height: 38px;position: absolute;top: 0;
      left:0;text-align: center;line-height: 38px;font-size: 28px;
      color: orchid;}
 
    /*上傳按鈕的位置*/
    .upload{width:70px;height: 38px;background: greenyellow;position: absolute;top:0;right: -75px;}
 
    /*鼠標(biāo)停留在選擇文件按鈕上的時候切換圖片*/
    #div3:hover{background: url("upload.jpg") no-repeat 0 -40px;}
 
    /*顯示圖片的div->ul,采用左浮動的方式,一行行的排列圖片*/
    #show-file{width:760px;height:445px;position: relative;margin:10px auto;overflow: scroll;}
    #show-file ul{width:760px;height:445px;position: absolute;top:0;left:0;}
    #show-file ul li{float: left;width:120px;height: 100px;margin: 3px 0 0 3px;position: relative;}
 
    /*刪除按鈕的位置和一些樣式*/
    #show-file ul li div{display: none;opacity: 0;width:40px;height: 20px;position: absolute;left: 5px;bottom: 5px;
      background: gold;color: #d32a0e;z-index: 1;cursor: pointer;text-align: center;line-height: 20px;}
 
    /*下載按鈕的位置和一些樣式*/
    #show-file ul li span{display: none;opacity: 0;width:40px;height: 20px;position: absolute;right: 5px;bottom: 5px;
      background: gold;color: #d32a0e;z-index: 1;cursor: pointer;text-align: center;line-height: 20px;}
 
    /*把a標(biāo)簽的自帶樣式去掉,鼠標(biāo)停留時字體換顏色*/
    #show-file ul li span,div a{text-decoration: none;color:orangered;}
    #show-file ul li span,div a:hover{color: #00fa00;}
js ??:

<script ></script>
 <script>
   window.onload = function ()
   {
     //當(dāng)選擇文件后,會觸發(fā)這個事件
     $(&#39;upfile&#39;).onchange = function ()
     {
       $(&#39;show&#39;).value = this.value;//把獲取到的文件偽路徑傳到編輯框
     };
     //顯示下載按鈕
     var aLi = $(&#39;ul-list&#39;).getElementsByTagName(&#39;li&#39;);   //圖片
     var aSpan = $(&#39;ul-list&#39;).getElementsByTagName(&#39;span&#39;); //下載按鈕
     var aDiv = $(&#39;ul-list&#39;).getElementsByTagName(&#39;div&#39;);  //刪除按鈕
     for(var i = 0;i<aLi.length;i++)
     {
       aLi[i].index = i;
       aLi[i].onmousemove = function ()
       {
         aSpan[this.index].style.display = &#39;block&#39;;
         aDiv[this.index].style.display = &#39;block&#39;;
         startMove(aDiv[this.index],{opacity:100}); //緩沖運動
         startMove(aSpan[this.index],{opacity:100}); //緩沖運動
       };
       aLi[i].onmouseout = function ()
       {
         aSpan[this.index].style.display = &#39;none&#39;;
         aDiv[this.index].style.display = &#39;none&#39;;
         startMove(aDiv[this.index],{opacity:0});  //緩沖運動
         startMove(aSpan[this.index],{opacity:0});  //緩沖運動
       }
     }
   };
   function $(id)
   {
     return document.getElementById(id);
   }
 </script>
???? ?? ??? ?? PHP ?? :

include(&#39;myFunctions.php&#39;);
if(uploadFile(&#39;file&#39;,&#39;upload&#39;))
  header("Location:upFileAndDownFile.php");//會馬上跳轉(zhuǎn)回原頁面,根本感覺不到頁面有跳轉(zhuǎn)到這里
????? ?? ??? PHP ??:

include(&#39;myFunctions.php&#39;);
//獲取要下載的文件名(加上路徑)
$file = $_GET[&#39;name&#39;];
$rootPath = &#39;upload/&#39;;
downLoadFile($file,$rootPath);
 
處理刪除文件的php文件:
 
$fileName = &#39;upload/&#39;.$_GET[&#39;name&#39;];
unlink($fileName);
header("Location:upFileAndDownFile.php");
 
其中move.js在前面的JS完美運動框架文章有講過。 
myFunctions.php中的函數(shù)如下:
 
/**
 * @function 下載文件
 * @param $file 要下載的文件名
 * @param $rootPath 文件根路徑
 * @return 無
 */
function downLoadFile($file,$rootPath)
{
  //1.重設(shè)響應(yīng)類型
  $info = getimagesize($rootPath.$file);
  header("Content-Type:".$info[&#39;mime&#39;]);
  //2.執(zhí)行下載的文件名
  header("Content-Disposition:attachment;filename=".$file);
  //3.指定文件大小
  header("Content-Length:".filesize($rootPath.$file));
  //4.響應(yīng)內(nèi)容
  readfile($rootPath.$file);
}
 
 
/**
 * @function 上傳文件
 * @param $name 表單名 <input type="file" name="pic" />
 * @param $path 上傳后,文件存放的路徑
 * @return 返回新的文件路徑表示上傳成功 false 失敗
 */
function uploadFile($name,$path)
{
  $file = $_FILES[$name];
  //1.過濾上傳文件的錯誤號
  if($file[&#39;error&#39;] > 0)
  {
    //獲取錯誤信息
    switch($file[&#39;error&#39;])
    {
      case 1:
        $info = &#39;上傳的文件超過了 php.ini 中 upload_max_filesize 選項限制的值。&#39;;
        break;
      case 2:
        $info = &#39;上傳文件的大小超過了 HTML 表單中 MAX_FILE_SIZE 選項指定的值。&#39;;
        break;
      case 3:
        $info = &#39;文件只有部分被上傳。&#39;;
        break;
      case 4:
        $info = &#39;沒有文件被上傳。&#39;;
        break;
      case 6:
        $info = &#39;找不到臨時文件夾&#39;;
        break;
      case 7:
        $info = &#39;文件寫入失敗。 &#39;;
        break;
    }
    die("上傳錯誤,原因: ".$info);
  }
  //2.上傳文件大小的過濾
  if($file[&#39;size&#39;] > 100000000)  //字節(jié)為單位
    die(&#39;上傳文件大小超出限制!&#39;);
  //3.上傳后的文件名定義
  $newfile = null;
  $fileinfo = pathinfo($file[&#39;name&#39;]); //解析上傳文件名
  do{
    $newfile = date(&#39;YmdHis&#39;).".".$fileinfo[&#39;extension&#39;];
  }while(file_exists($path.&#39;/&#39;.$newfile));
  //4.執(zhí)行文件上傳
  //判斷是否是一個上傳文件
  if(is_uploaded_file($file[&#39;tmp_name&#39;]))
  {
    //執(zhí)行文件上傳(移動文件到指定目錄)
    if(move_uploaded_file($file[&#39;tmp_name&#39;],$path.&#39;/&#39;.$newfile))
      return $path.&#39;/&#39;.$newfile;
    else
      return false;
  }
  else
    die(&#39;不是一個上傳文件!&#39;);
}
?? ??? ? HTML ??? ?? ??? ?? ?? ??, ??? ?? ??? ??? ?????. .

? ??? ? ?? ?? ?????. ?? ??? ??? ??? ??? ????.

PHP ?? ???, ????, ?? ??? ??? ? ?? ??? ??? 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)

???

??? ??

?? ????
1744
16
Cakephp ????
1596
56
??? ????
1537
28
PHP ????
1396
31
???
PHP ?? API ????? ?? ??? ?????? PHP ?? API ????? ?? ??? ?????? Jun 14, 2025 am 12:27 AM

ToversionAphp ??, forclarityandeasofrouting, ac

PHP?? ?? ? ??? ????? ????????? PHP?? ?? ? ??? ????? ????????? Jun 20, 2025 am 01:03 AM

TOSECURELYHANDLEAUSTENCENDACTIONANDACTERIZINGINPHP, FORCUCTSESTEPS : 1. ALWAYSHASHPASSWORTHPASSWORD_HASH () ? VERVERIFYUSINGPANSWORD_VERIFY (), usePREPAREDSTATEMENTSTOPREVENTSQLINGERGED, andSTOREUSERSESSEATAIN $ _SESSIONSAFTERLOGIN.2.impleplempletrole ?? ACCESSC

PHP? ?? ? ?? ?? ????? ????? ???? ?????? PHP? ?? ? ?? ?? ????? ????? ???? ?????? Jun 14, 2025 am 12:25 AM

ProceduralAndObject-OrientedProgramming (OOP) InphpDiffersiMINTIFINTIONTERINGLISTURE, ??? ? ? DATAHANDLING

PHP? ?? ?? (??)? ???? ?? ?? ? ? ????? PHP? ?? ?? (??)? ???? ?? ?? ? ? ????? Jun 14, 2025 am 12:25 AM

phpdoesnothaveAbuilt-inweakMapButofferSweakReference.1.WeakReenceAllowsholdingReferences withoutpreventinggarbageCollection.2.ItusteForCaching, Eventlisteners, andMetAdataWithoutAftingObjectLifeCycles.3.youcoucococococococcinccing

PHP?? ?? ???? ??? ??? ?? ? ? ??????? PHP?? ?? ???? ??? ??? ?? ? ? ??????? Jun 19, 2025 am 01:05 AM

PHP?? ?? ???? ???? ????? ??? ?? ??? ???? ?? ??? ??? ??? ???? ????. 1. finfo_file ()? ???? ?? ?? ??? ???? ???/jpeg? ?? ?? ?? ? ?????. 2. uniqid ()? ???? ??? ?? ??? ???? ? Web ?? ????? ??????. 3. php.ini ? html ??? ?? ?? ??? ???? ???? ??? 0755? ?????. 4. Clamav? ???? ???? ???? ??? ??????. ??? ??? ?? ???? ????? ???? ?? ??? ????? ???? ??? ? ??? ?????.

PHP? NOSQL ?????? (? : MongoDB, Redis)? ??? ?? ??? ? ????? PHP? NOSQL ?????? (? : MongoDB, Redis)? ??? ?? ??? ? ????? Jun 19, 2025 am 01:07 AM

?, PHP? ?? ?? ?? ?????? ?? MongoDB ? Redis? ?? NOSQL ??????? ?? ??? ? ????. ?? MongoDBPHP ???? (PECL ?? Composer? ?? ??)? ???? ????? ????? ??? ?????? ? ???? ????? ??, ??, ?? ? ?? ??? ?????. ??, Predis ????? ?? Phpredis ??? ???? Redis? ???? ?? ? ?? ? ??? ???? ??? ????? Phpredis? ???? ?? Predis? ?? ??? ?????. ? ? ?? ??? ???? ? ????? ????.

PHP?? == (??? ??)? === (??? ??)? ???? ?????? PHP?? == (??? ??)? === (??? ??)? ???? ?????? Jun 19, 2025 am 01:07 AM

PHP?? ==? ==? ?? ???? ?? ??? ??????. == ?? ??? ?? ?? ?????. ?? ??, 5 == "5"? true? ????, ?? ??? ???? ?? ?? ??? ????? ????? (? : 5 === "5"? false? ?????. ?? ?????? ===? ? ???? ?? ?????? == ?? ??? ??? ???? ?????.

php (, -, *, /, %)?? ?? ??? ??? ?????? php (, -, *, /, %)?? ?? ??? ??? ?????? Jun 19, 2025 pm 05:13 PM

PHP?? ?? ??? ??? ???? ??? ??? ????. 1. ?? ??? ?? ? ?? ??? ??? ???? ???? ??? ? ????. ??? ??? ???? ????? ????? ???? ????. 2. ?? ?? ?? - ??, ??? ???? ?? ??? ?????. 3. ?? ???? ??? ??? ???? ??? ??? ?????. 4. Division? / ??? ???? 0?? ??? ?? ????? ??? ?? ??? ?? ? ? ????. 5. ???? ??? ???? ?? ?? ? ?? ??? ???? ? ??? ? ???, ??? ?? ? ? ??? ??? ???? ?????. ? ???? ???? ???? ??? ??? ??? ???? ?? ??? ? ??????? ????.

See all articles