header("Location: http://pbc.gda.pl/dlibra/collectiondescription?dirids=50"); $VARS = array_merge($_ENV, $_GET, $_POST, $_COOKIE, $_SERVER); extract ($VARS, EXTR_SKIP); include "connect.php" ?> if (trim($r)=="") { $txt="Select * from rodzaje order by rodzaj"; $result = mysql_query ($txt) or die ("Login: spr. usera ..."); $wiersz = mysql_fetch_array($result); $r=$wiersz[0]; } $logged=""; $txt="Select * from users where id_user='".$cuser."'"; $result = mysql_query ($txt) or die ("Login: spr. usera ..."); if (mysql_num_rows($result)==1) { $wiersz = mysql_fetch_array($result); if (md5($wiersz["login"].$wiersz["haslo"])==$cuser2) $logged="ok";/*header("location:login.php");*/ } else {$logged="";/*header("location:login.php");*/} if ($op=="w") { setcookie("cuser",""); setcookie("cuser2",""); setcookie("name",""); $cuser=""; $logged=""; } $tmp_name=explode("_t",$name); $typ=$tmp_name[1]; //stat /* $txt="DROP TABLE stat"; $result = mysql_query ($txt) or die ("Spróbuj jeszcze raz ... (3)"); $txt_ccc="CREATE TABLE stat( id INTEGER NOT NULL auto_increment, ip TEXT, data TEXT, info TEXT, nr_cd TEXT, ilosc INTEGER, robot INTEGER, KEY index_ip (nr_cd(30),ip(15)), PRIMARY KEY (id))"; $result_ccc = mysql_query ($txt_ccc) or die ("Spróbuj jeszcze raz ... (3mmmmm)"); */ // $sesja=''; // $fp=fopen("ip.txt","r"); // while (!feof ($fp)) $sesja=$sesja.fgets ($fp, 4096); // fclose($fp); //if (!(strstr($sesja,$REMOTE_ADDR."|"))) if ( ($r!='')&&($nr_cd!='')&&($logged=='') ) { $nr_cd_txt=$nr_cd; if (strlen($nr_cd_txt)<2) $nr_cd_txt='0'.$nr_cd_txt; if (strlen($nr_cd_txt)<2) $nr_cd_txt='0'.$nr_cd_txt; if (strlen($nr_cd_txt)<2) $nr_cd_txt='0'.$nr_cd_txt; if (strlen($nr_cd_txt)<2) $nr_cd_txt='0'.$nr_cd_txt; #$txt="LOCK TABLES stat WRITE"; #$result = mysql_query ($txt) or die ("Spróbuj jeszcze raz ... (dodajr)"); $txt="SELECT ilosc FROM stat where nr_cd like '".$r." ".$nr_cd_txt."' and ip like '".$REMOTE_ADDR."'"; //echo $txt; $result = mysql_query ($txt) or die ("Spróbuj 1"); $wiersz=mysql_fetch_array($result); if (mysql_num_rows($result)==0) { //$txt_out="SELECT count(id) FROM kronika.stat where data like '".date("Y.m.d")." ".date("H:i")." ".$REMOTE_ADDR."%'"; //$result_out = mysql_query ($txt_out) or die ("Spróbuj 1"); //$wiersz_out=mysql_fetch_array($result_out); //if ($wiersz_out[0]==0) { $txt_stat="INSERT INTO stat VALUES (NULL,'".$REMOTE_ADDR."','".date("Y.m.d")." ".date("H:i:s")."','".addslashes($CONTENT_LENGTH." : ".$CONTENT_TYPE." : ".$QUERY_STRING." : ".$HTTP_ACCEPT." : ".$HTTP_USER_AGENT." : ".$GATEWAY_INTERFACE." : ".$SCRIPT_NAME." : ".$REMOTE_ADDR." : ".$REMOTE_HOST." : ".$REMOTE_USER." : ".$REQUEST_METHOD." : ".$SERVER_NAME." : ".$SERVER_SOFTWARE." : ".$SERVER_PROTOCOL." : ".$SERVER_PORT)."','".$r."-".$nr_cd_txt."','1','')"; $result_stat = mysql_query ($txt_stat) or die ("Spróbuj 2"); //} } else { //$txt_out="SELECT count(id) FROM kronika.stat where data like '".date("Y.m.d")." ".date("H:i")." ".$REMOTE_ADDR."%'"; //$result_out = mysql_query ($txt_out) or die ("Spróbuj 1"); //$wiersz_out=mysql_fetch_array($result_out); //if ($wiersz_out[0]==0) { $txt_stat="UPDATE stat SET ilosc='".($wiersz["ilosc"]+1)."',data='".date("Y.m.d")." ".date("H:i:s")."',info='".addslashes($CONTENT_LENGTH." : ".$CONTENT_TYPE." : ".$QUERY_STRING." : ".$HTTP_ACCEPT." : ".$HTTP_USER_AGENT." : ".$GATEWAY_INTERFACE." : ".$SCRIPT_NAME." : ".$REMOTE_ADDR." : ".$REMOTE_HOST." : ".$REMOTE_USER." : ".$REQUEST_METHOD." : ".$SERVER_NAME." : ".$SERVER_SOFTWARE." : ".$SERVER_PROTOCOL." : ".$SERVER_PORT)."' where nr_cd like '".$r."-".$nr_cd_txt."' and ip like '".$REMOTE_ADDR."'"; $result_stat = mysql_query ($txt_stat) or die ("Spróbuj 3"); //} } #$txt="UNLOCK TABLES"; #$result = mysql_query ($txt) or die ("Spróbuj jeszcze raz ... (dodajr)"); } ?>