<style type="text/css" media="screen">@import "body.css";</style>
<style type="text/css" media="screen">@import "div.php?w=300&h=400";</style>
<link rel="stylesheet" type="text/css" href="fonts.php?s=24&c=red">
<body>
<div>
this document has a #e4e4e4 background, a 300px/400px div, and a arial/24px/red words.
</div>
</body>
div.php
<?php
// declare the output of the file as CSS
header('Content-type: text/css');
// include the script
//include('others.php');
$width = $_GET['w'];
$height = $_GET['h'];
?>
div{width:<?=$width?>px;height:<?=$height?>px;border:blue 1px solid;}
fonts.php
<?php
// declare the output of the file as CSS
header('Content-type: text/css');
// include the script
//include('others.php');
$size = $_GET['s'];
$color = $_GET['c'];
?>
body{font-family:arial;font-size:<?=$size?>px;color:<?=$color?>}
转载注明出处:
http://justcoding.iteye.com/blog/1017497