<?php
if ( !defined( 'SMARTY_DIR' ) ) {
	include_once( 'init.php' );
}

$id = $_GET['id'];

$row =& $osDB->getRow( 'SELECT clicks, linkurl FROM ! WHERE id = ?', array( BANNER_TABLE, $id ) );

$clicks = $row['clicks'] + 1;
$linkurl = $row['linkurl'];

$osDB->query( 'UPDATE ! SET clicks = ? WHERE id = ?', array( BANNER_TABLE, $clicks, $id ) );
unset($row);
header( 'location: ' . $linkurl );

exit;
?>