我有一个index.php文件,它根据条件加载(需要)2个不同的文件。如何根据条件加载动态CSS文件
访问此链接将导致;
mysite.com/index.php将加载stats.php(要求( “stats.php”);)
访问该链接会引起;
mysite.com/index.php?auth="jgbsbsbasm”将加载encry.php(require("stats_encry.php");
)
完成与此代码:
<?php
if(isset($_GET['auth'])) require("stats.php");
else require("stats_encry.php");
?>
这工作得很好。现在我的问题是,我在标题中有一个CSS文件作为静态;
<link rel="stylesheet" href="cv.css">
我想要什么,现在是分别加载cv.css文件stats.php和cv1.css为stats_encry.php。
我该怎么做?
你好,谢谢,但它不工作; 在这一行获取语法错误 - > {<?php else {?>} –
已编辑,现在尝试 –
Whoopie doo!奇迹般有效。我喜欢stackoverflow! 非常感谢你的配偶:) –