p4F Posted September 15, 2007 Report Share Posted September 15, 2007 (edited) kā lai izdara lai no viena IP varētu ieiet vienlaikus tikai 1 cilvēks es tā domāju ar preg_match varētu bet kā izdarīt nezinu ;[ Edited September 15, 2007 by p4F Link to comment Share on other sites More sharing options...
Kristabs Posted September 15, 2007 Report Share Posted September 15, 2007 (edited) Apmēram šādi: Pie katras kustības if(!check_online()){ add_activity(); } else{ //no shiis ip jau pashlaik skataas lapu } function check_online(){ select count(*) from online_ips where ip = REMOTE_ADDR and last_activity < 'cik nu tur minuutes' list($num) = _fetch_array($result); if($num == 0){ return FALSE; } return TRUE; } function add_activity(){ insert/update online_ips set last_activity = mktime(); } Update: Aa, un plus veel sesiju vai kuukiju klaat tam, kuram driikst skatiities, savaadaak sanaak, ka tikai vienu klikshkji var izdariit :)) Edited September 15, 2007 by Kristabs Link to comment Share on other sites More sharing options...
p4F Posted September 15, 2007 Author Report Share Posted September 15, 2007 (edited) bet ar preq_match nevar ne kaa? Edited September 15, 2007 by p4F Link to comment Share on other sites More sharing options...
Kristabs Posted September 15, 2007 Report Share Posted September 15, 2007 A Tu zini, ko dara preg_match() ? :) Link to comment Share on other sites More sharing options...
p4F Posted September 15, 2007 Author Report Share Posted September 15, 2007 (edited) A Tu zini, ko dara preg_match() ? :) ka es atceros tas atlauj vai aizliec kaadu darbu if (((preg_match ($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT'])))) { sheit iet kad ieiet } nui kautkā tā kaa lai vinsh ieietu vienureizi ar ip vienlaikus Edited September 15, 2007 by p4F Link to comment Share on other sites More sharing options...
Kristabs Posted September 15, 2007 Report Share Posted September 15, 2007 preg_match ir funkcija tikai regulāro izteiksmju salīdzināšanai. Uzzīmē blokshēmu tam ko Tev vajag, salīdzināšana ir mazākais no tā visa, pie tam var iztikt ar parastu == Link to comment Share on other sites More sharing options...
Recommended Posts