Poniżej zamieszczam jedynie potrzebne w tym momencie metody tej klasy:
<?php class session { # Session data var $session_key = 0; var $session_ip = ''; var $session_browser = ''; var $session_time = 0; # Guest data var $ip = ''; var $browser = ''; var $type = 0; # Others var $auth = OFF; # Constructor function session() { $this -> spy_guest(); $this -> garbage_collector(); if( $this -> type == WEBBOT ) { $this -> bot_session(); return 1; } if( $this -> auth_session() ) { $this -> prepare_session(); return 1; } $this -> start_session(); return 0; } # Start new session function start_session() { if( $this -> auth == ON ) { return 0; } $t_sessions_table = config_get( 'sessions_table' ); $t_path = config_get( 'path' ); $t_default_include = config_get( 'default_include' ); $db -> sql_query( 'INSERT INTO '. $t_sessions_table .' ( session_key, ip, browser, time ) VALUES ( ''. $t_key .'', ''. $this -> ip .'', ''. $this -> browser .'', ''. time() .'' )' ); } # Check if session is set function auth_session() { if( $this -> type !== GUEST ) { $this -> auth = OFF; return 0; } $t_url_vars = config_url_get(); { $t_sessions_table = config_get( 'sessions_table' ); $db -> sql_query( 'SELECT id FROM '. $t_sessions_table .' WHERE session_key = ''. $this -> session_key .''' ); if( $db -> sql_numrows() >= 1 ) { $this -> auth = ON; return 1; } } $this -> auth = OFF; return 0; } ?>
Teraz przejdzmy do mojego problemu. Chodzi o to że przy każdym odpaleniu skryptu do bazy dodają się 3 rekordy zamiast jednego. Nie wiem czemu tak jest. Wydaje mi się że wszystko zrobiłem ok. Sprawdzałem to już na dwóch kompach i ciągle to samo.
Proszę o pomoc

Dodam, że te trzy dodane wpisy mają różne generowane klucze z czego pierwszy dodany jest właściwy... nie wiem co się z tym dzieje ... tak jakby przekierowywał trzy razy zamiast raz.
EDIT: Doszedłem do tego ze z klasa jest wszystko ok tylko cos gryzie sie ze smartami... mam klase dziedziczaca ze smarty:
<?php require_once( $g_smarty_path . '/Smarty.class.php' ); class my_smarty extends Smarty { function my_smarty() { $this -> Smarty(); $this -> template_dir = './templates/'; $this -> compile_dir = './templates_c/'; $this -> caching = false; $this -> debugging = false; } } ?>
I jesli w index zahashuje linie:
$smarty -> display( 'index.tpl' );
Wszystko jest ok... i dodaje tylko jeden wpis do bazy.
Teraz tylko pytanie jak mozna to naprawic
