GGC

News
Main
Links
SourceForge forum
SourceForge downloads
Javadoc documentation
About this project
Deutsche Flagge Deutsche Version

Legal
Webpages' source

SourceForge.net Logo


Should you experience any difficulties with any of the above pages, please drop the sitemaster a note.

Best viewed with any browser

<?php
include_once('../php/session.inc');
include_once(
'../php/db.inc');
$db=mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname);
$query='SELECT value FROM '.$misctab.' WHERE name LIKE "visits"';
//$query='CREATE TABLE misc (name VARCHAR(30) NOT NULL PRIMARY KEY, value VARCHAR(255))';
//$query='INSERT INTO misc VALUES ("visits", "0")';
if ($result=mysql_query($query))
 
$row=mysql_fetch_row($result);
else
{
 echo 
'Error: '.mysql_error();
 exit();
}
$value=$row[0];
/*echo '<pre>';
print_r($row);
echo '</pre>';*/
if (has_session()&&!$_SESSION['counted'])
{
$value++;
 
$query='UPDATE '.$misctab.' SET value=(value+1) WHERE name LIKE "visits"';
 if(!
mysql_query($query))
 {
  echo 
'Error: '.mysql_error();
  exit();
 }
 
$counted=TRUE;
 @
session_register('counted');
}
mysql_close($db);
echo 
$value;
?>

Visitor count: 11886