复制代码 代码如下:
<?php
$linkArr = array(
'index.php' => '汇总首页',
'List.php' => '列表',
'Detail.php' => '详细',
'http://qzone.qq.com/' => 'QQ空间',
'http://qun.qzone.qq.com/group'=> '腾讯群首页',
'login.php?act=logout' => '安全退出',
);
?>
<?php
foreach($linkArr as $k => $v)
{
if(basename($k) == basename($_SERVER['PHP_SELF']))
{
$class = '';
if(!defined('PAGE_TITLE')) define('PAGE_TITLE', $v);
} else {
$class = '';
}
echo '<input type="button" value="'.$v.'" '.$class.' _url="'.$k.'" />';
}
?>
<script>
var PAGE_TITLE = <?php echo json_encode(defined('PAGE_TITLE') ? PAGE_TITLE : '');?>;
if(PAGE_TITLE) document.title = PAGE_TITLE + ' ' + document.title;
function Daohang(obj)
{
var url = obj.getAttribute('_url');
if(/^https?:////.+/i.test(url))
{
window.open(url,'');
} else {
window.location = url;
}
}
</script>
新闻热点
疑难解答