-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.php
More file actions
61 lines (51 loc) · 1.38 KB
/
button.php
File metadata and controls
61 lines (51 loc) · 1.38 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
include_once('inc.php');
$url = $_SERVER['HTTP_REFERER'];
$count = 0;
//DB操作
if($db = sqlite_open('iine.db',0705,$errmsg)){
//テーブル作成
$sql = "CREATE TABLE iine (title text, url text, count integer, rdate integer, udate integer)";
@sqlite_query($db, $sql);
//サニタイズ
$url_sqlite = sqlite_escape_string($url);
//現在のカウントを取得
$sql = "SELECT count FROM iine WHERE url='$url'";
$result = sqlite_query($db, $sql);
if ($array = sqlite_fetch_array($result)) {
$count = $array['count'];
}
sqlite_close($db);
} else {
//print_r($errmsg);
}
?>
<html>
<head>
<meta name="viewport" content="width=500px;" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?= $SITE_TITLE ?></title>
<style type="text/css">
<!--
* {
font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif;
margin:0px; padding:0px;
}
//-->
</style>
</head>
<body>
<form name="form1" action="click.php" method="POST">
<input type="hidden" name="title">
<input type="hidden" name="url" value="<?= $url ?>">
<input type="submit" value="<?= $BUTTON_CAPTION ?>" style="font-size:9px; width:45px; height:20px;">
<span style="font-size:9px;"><?= $count ?>
</span>
</form>
<script type="text/javascript">
<!--
document.form1.title.value = parent.document.title;
//-->
</script>
</body>
</html>