久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php如何禁止視頻url下載

      php禁止視頻url下載的方法:首先設(shè)置好“detail.html”模板內(nèi)容;然后做一個(gè)token用于失效方案;接著在php文件中通過(guò)vid獲取數(shù)據(jù)庫(kù)存放的真實(shí)資源地址;最后刪除token,保證視頻每次只能播放一次即可。

      php如何禁止視頻url下載

      推薦:《PHP視頻教程》

      php防止視頻資源被下載

      假如資源地址 : http://xxx.com/videoData/xxx.mp4 即可實(shí)現(xiàn)播放;

      detail.html模板內(nèi)容

      <video controls="controls" autoplay="autoplay"> <source type="video/ogg" src="xxx.com/goVideo.php?video=1" /><!--這樣的地址他們就醉了吧,真實(shí)地主保護(hù)住了 而且每次進(jìn)入詳情頁(yè)播放完了,重新進(jìn)入detail鏈接方法中,才能播放 -->  Your browser does not support the video tag. </video>

      detail.php控制層內(nèi)容

      // 先進(jìn)入詳情頁(yè) publicfunction detail(){ $_SESSION['token'] = md5("xxx"); //做一個(gè)token 用于失效方案 //進(jìn)入到詳情頁(yè) }

      goVideo.php代碼如下

      /**       +----------------------------------------------------------       * 生成html video 播放地址       +----------------------------------------------------------       * @access public       +----------------------------------------------------------       */       public function goVideo()       {          $vid = (int)$_GET['videoId']; //數(shù)據(jù)庫(kù)存放的資源id        $data = $this->getInfo($vid); //通過(guò)vid 獲取 數(shù)據(jù)庫(kù)存放的真實(shí)資源地址         if($_SESSION["token"]){               unset($_SESSION["token"]); //刪除token,保證每次只能播放一次                   //頁(yè)面直接輸出視頻         $filePath=$data['URL'];         ini_set('memory_limit', '512M');         header("Pragma: public");         header("Expires: 0");         header("Content-Type: application/octet-stream"); //文件mime類型         //header("Content-Disposition: attachment; filename=video11.mp4;" ); //文件名$filename         //header("Content-Length: 83995");  //文件大小$fsize         ob_clean();         flush();         //ob_end_clean();         @readfile($filePath);         }       }

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)