⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 down.php

📁 十大精典PHP项目开发全程案例+代码
💻 PHP
字号:
<?php session_start();
$id=$_GET[id];
$hostname=$_SESSION[host];
$username=$_SESSION[user];
$userpwd=$_SESSION[pwd];
if(!$mbox=@imap_open("$hostname","$username","$userpwd")){
   echo "<script>alert('登录超时,请重新登录!');history.back();</script>";
   exit;
}
$structure= imap_fetchstructure($mbox,$id); 
$array=$structure->parts;

if(($array[1]->dparameters[0]->value)!=""){
  $filename=$array[1]->dparameters[0]->value;
}else{
  $filename=$array[1]->description;
}
if(strtolower(substr($filename,0,10))==strtolower("=?gb2312?B"))
   $filename=base64_decode(substr($filename,11,(strlen($filename)-13)));
header("Content-type:application/octet-stream");
header("Accept-ranges:bytes");
header("Accept-length:100");
header("Content-Disposition:attachment;filename=".$filename."");
$text=imap_fetchbody($mbox,$id,2);
echo imap_base64($text);
imap_close($mbox);
exit;
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -