📄 read_html.php
字号:
<?php
include_once( "inc/auth.php" );
$query = "SELECT * from HTML_FILE WHERE HTML_ID=".$HTML_ID;
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$FILE_NAME = $ROW['FILE_NAME'];
}
$URL = "../../../module/html_model/".$FILE_NAME;
if ( !file_exists( $URL ) )
{
echo "找不到文件:".$HTML_ID;
exit( );
}
$file_ext = strtolower( substr( $HTML_ID, strpos( $HTML_ID, "." ) ) );
switch ( $file_ext )
{
case ".jpg" :
case ".bmp" :
case ".gif" :
case ".png" :
case ".wmv" :
case ".html" :
case ".htm" :
case ".wav" :
case ".mid" :
case ".mht" :
$COTENT_TYPE = 0;
$COTENT_TYPE_DESC = "application/octet-stream";
break;
case ".pdf" :
$COTENT_TYPE = 0;
$COTENT_TYPE_DESC = "application/pdf";
break;
case ".swf" :
$COTENT_TYPE = 0;
$COTENT_TYPE_DESC = "application/x-shockwave-flash";
break;
$COTENT_TYPE = 1;
$COTENT_TYPE_DESC = "application/octet-stream";
}
ob_end_clean( );
header( "Cache-control: private" );
header( "Content-type: ".$COTENT_TYPE_DESC );
header( "Accept-Ranges: bytes" );
header( "Accept-Length: ".filesize( $URL ) );
if ( $COTENT_TYPE == 1 )
{
header( "Content-Disposition: attachment; filename=".$HTML_ID );
}
else
{
header( "Content-Disposition: filename=".$HTML_ID );
}
readfile( $URL );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -