summaryrefslogtreecommitdiff
path: root/www-ssl/inc/funktion_counter.php
diff options
context:
space:
mode:
Diffstat (limited to 'www-ssl/inc/funktion_counter.php')
-rw-r--r--www-ssl/inc/funktion_counter.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/www-ssl/inc/funktion_counter.php b/www-ssl/inc/funktion_counter.php
new file mode 100644
index 00000000..70b104d4
--- /dev/null
+++ b/www-ssl/inc/funktion_counter.php
@@ -0,0 +1,24 @@
+<?PHP
+
+$SQL = "SELECT `Anz` FROM `Counter` WHERE `URL`=\"". $Page["Name"]. "\"";
+$Erg = mysql_query($SQL, $con);
+
+echo mysql_error($con);
+
+if(mysql_num_rows($Erg)==0)
+{
+// echo "Counter: 1";
+ $SQL = "INSERT INTO `Counter` ( `URL` , `Anz` ) ".
+ "VALUES ('". $Page["Name"]. "', '1');";
+ $Erg = mysql_query($SQL, $con);
+}
+elseif(mysql_num_rows($Erg)==1)
+{
+// echo "Counter: ". (mysql_result($Erg, 0, 0)+1);
+ $SQL = "UPDATE `Counter` SET `Anz` = '". (mysql_result($Erg, 0, 0) +1). "' ".
+ "WHERE `URL` = '". $Page["Name"]. "' LIMIT 1 ;";
+ $Erg = mysql_query($SQL, $con);
+}
+
+
+?>