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

📄 getchart.php

📁 一个绝对棒的报表绘图软件
💻 PHP
字号:
<?php
session_cache_limiter("private_no_expire"); 
if (!session_id()) { session_start(); }

$filename = null;
if (isset($_GET))
{
	$image = $_SESSION[$_GET["img"]];
	if (isset($_GET["filename"]))
		$filename = $_GET["filename"];
}
else
{
	$image = $HTTP_SESSION_VARS[$HTTP_GET_VARS["img"]];
	if (isset($HTTP_GET_VARS["filename"]))
		$filename = $HTTP_GET_VARS["filename"];
}

$contentType = "text/html; charset=utf-8";
if (strlen($image) >= 3)
{
	$c0 = ord($image[0]);
	$c1 = ord($image[1]);
	$c2 = ord($image[2]);
	if (($c0 == 0x47) && ($c1 == 0x49))
		$contentType = "image/gif";
	else if (($c1 == 0x50) && ($c2 == 0x4e))
		$contentType = "image/png";
	else if (($c0 == 0x42) && ($c1 == 0x4d))
		$contentType = "image/bmp";
	else if (($c0 == 0xff) && ($c1 == 0xd8))
		$contentType = "image/jpeg";
	else if (($c0 == 0) && ($c1 == 0))
		$contentType = "image/vnd.wap.wbmp";
	else if (($c0 == 0x1f) && ($c1 == 0x8b))
		header("Content-Encoding: gzip");
}

header("Content-type: $contentType");
if ($filename != null)
	header("Content-Disposition: inline; filename=$filename");
print $image;
?>

⌨️ 快捷键说明

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