diff options
author | Philip Häusler <msquare@notrademark.de> | 2011-06-02 01:09:03 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2011-06-02 01:09:03 +0200 |
commit | 10683c4759c2c3563ff7ed48b15d12e85cd0631b (patch) | |
tree | a6c2b76a3a2c088a86b7a882afefb67424f48334 /includes/sys_counter.php | |
parent | c90fdf75a26e6abf2434068d4aa3cfcb190eb600 (diff) |
counter
Diffstat (limited to 'includes/sys_counter.php')
-rw-r--r-- | includes/sys_counter.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/sys_counter.php b/includes/sys_counter.php new file mode 100644 index 00000000..abcb652b --- /dev/null +++ b/includes/sys_counter.php @@ -0,0 +1,10 @@ +<?php +function counter() { + global $p; + + if (sql_num_query("SELECT `Anz` FROM `Counter` WHERE `URL`='" . sql_escape($p) . "'") == 0) + sql_query("INSERT INTO `Counter` ( `URL` , `Anz` ) VALUES ('" . sql_escape($p) . "', '1');"); + else + sql_query("UPDATE `Counter` SET `Anz` = `Anz` + 1 WHERE `URL` = '" . sql_escape($p) . "' LIMIT 1 ;"); +} +?> |