typecho判断域名调用不同表前缀

发表于 2013-06-26   |   分类于 笔记
if($_SERVER["HTTP_HOST"]=="a.com" || $_SERVER["HTTP_HOST"]=="www.a.com"){
$db = new Typecho_Db('Mysql', 'a_');
}
else if($_SERVER["HTTP_HOST"]=="b.com" || $_SERVER["HTTP_HOST"]=="www.b.com"){
$db = new Typecho_Db('Mysql', 'b_');
}
© 2020 Powered by Typecho & Theme Quark