-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
47 lines (47 loc) · 1.52 KB
/
index.php
File metadata and controls
47 lines (47 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
require_once 'config.php';
//查询访问来的域名信息
$url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$url = get_host_domain($url);
$info = $db->get("park", "*", array("domain" => "{$url}"));
if($info)
{
//更新访问次数
$db->update('park', array("views[+]" => 1), array("id" => $info['id']));
//判断跳转域名
if($info['type'] == 2)
{
header("location:{$info['url']}");
exit;
}
}
else
{
exit('<h2>no data</h2>');
}
?>
<!DOCTYPE html>
<html lang="zh-CN" class="no-js">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="renderer" content="webkit">
<title><?php echo $info['title']; ?></title>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="/css/amazeui.min.css" type="text/css">
<link rel="stylesheet" href="/css/app.css" type="text/css">
</head>
<body>
<div class="am-container am-text-center am-margin-top-xl">
<h2>欢迎访问<?php echo $info['title'];?></h2>
<p><?php echo $info['description'];?></p>
<?php if($info['price']):?>
<p>售价:¥<?php echo $info['price'];?></p>
<?php endif;?>
<?php if($info['email']):?>
<p><?php echo $info['email'];?></p>
<?php endif;?>
</div>
</body>
</html>