【发布时间】:2014-06-22 17:37:31
【问题描述】:
类函数(位于php/php_includes/easyCMSv2.php)
public function get_file($file){
ob_start();
include('php/'.$file);
$file = ob_end_clean();
return $file;
}
stylesheet_config.php(位于 php/css)
<?php
$blue = "#4C66A4";
$red = "#A44C4C";
?>
stylesheet.php(位于 php/css)
<?php
ob_start ("ob_gzhandler");
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
$if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']);
} else {
$if_modified_since = '';
}
$mtime = filemtime($_SERVER['SCRIPT_FILENAME']);
$gmdate_mod = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';
if ($if_modified_since == $gmdate_mod) {
header("HTTP/1.0 304 Not Modified");
exit;
}
header("Last-Modified: $gmdate_mod");
header('Content-type: text/css');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (60*60*24*45)) . ' GMT');
include_once('../php_includes/easyCMSv2.php');
require('stylesheet_config.php');
$cms = new Template($connect);
if(isset($_GET['v'])){
$cms->get_file('css/'.$_GET["v"].'.php');
}
?>
$_GET['v'] = 1-23-1
1-23-1.php(位于php/css)
div{
color:<?=$blue?>;
background:<?=$red?>;
}
虽然每次我访问 url(通过链接标签或直接 url)它都会返回 1 谁能向我解释为什么它一直返回 1?
【问题讨论】: