Jump to content
php.lv forumi

ainars

Reģistrētie lietotāji
  • Posts

    27
  • Joined

  • Last visited

Everything posted by ainars

  1. Tur jau taa lieta, ka burts "š" neattēlojas pēc hīdera izmainīšanas, kad ieliku jaunu ziņojumu :( Kas burtam "š" nepatīk???
  2. Jau pamēģināju {<META http-equiv=Content-Type content="text/html; charset=UTF-8">}, bet tagad uzspiežot uz komentāriem ... atkal burts "ē" gļuko :(
  3. Nu jā it kā.... bet kāpēc tad tas pats "ī" radas tā kā vajag.... esmu jau izmēģinājis daudzus variantus..... ja txt failu pieseivoju kā unicode, tad vispār tie neattēlojas.... :(
  4. Tu domā, ka nav jau uzlikts... :angry: TAd jau arī pārejie nerādītos korekti!!! Labi nākoso ieteikumu!!!
  5. Nezinu, kas tas par programmas kļūdu, bet apskatiet paši SITKANA game homepage pievērsiet uzmanību jauno ziņojumu textam, kur tieš burts "š" netiek attēlots, bet parejais it kā OK!!! Kas par vainu?? Kā to noverst?? :ph34r:
  6. šo progu var dabūt CutePHP....
  7. encodings PHP??? nezinu ka tur kaut ko var nomainīt.... :o Lapā ir vecais labais charset=windows-1257, bet PHP......
  8. Izmantojot ziņu ievietošanas skriptu Cutephp rodas garumzīmju problēmas: Ievietojot ziņu, man rādas: ..... bet lapas jaunumu sadaļā taisa murgu...., kas izskatās šādi: Kas nepareizi??? :unsure:
  9. Saitā šādu scriptu neizmantošu.... ieliku to tikai lai Jums būtu ko notestēt :)
  10. <?php /* Title: Proxy Detection Version: v2.0 Description: This will detect any suspicious open socket that the user is running and if found in an array, it will not let the user proceed to the website, with the ability to allow certain hosts to pass the scan, and disallowing certain hosts completely. You can define a redirect page to redirect the user to upon open socket. Usage: Just include this page in any webpage you want protected. */ /* Modify these next few lines to whatever you like. */ $Ports = array('1080', '8080', '8000', '3128', '8888', '23', '80', '8081'); // To hold the list of ports. $AllowedHosts = array('localhost', 'allowedhost.com'); // To hold the list of allowed hosts. $DisallowedHosts = array('127.0.0.1.poo.com', 'something.msn.com'); // To hold the list of disallowed hosts. $Redirect = "http://www.unixcon.net/~datalogik/scripts/"; // Redirect page $SocketTimeout = 1; // Higher the number, the longer it takes. /* End of modification. */ if ((!in_array ($REMOTE_ADDR, $AllowedHosts)) && (!in_array ($REMOTE_ADDR, $DisallowedHosts))) { $x = 1; while ($Ports[$x]) { $fSockPointer = fsockopen($REMOTE_ADDR, $Ports[$x], $errno, $errstr, $SocketTimeout); if ($fSockPointer) { header ("Location: $Redirect"); fclose($fSockPointer); } $x++; } } else { if (in_array ($REMOTE_ADDR, $AllowedHosts)) { die(); } else { header ("Location: $Redirect"); die(); } } ?> :ph34r:
  11. Man viss shansee.... skaties varbut Tev koda klluuda...
  12. Jā ideja laba, tikai http://eclub.lv nav bezmaksas SQL.... vai nevar txt listingu???
  13. Nezinu kāpēc Tev tas errors parādījās, bet.... line 235 ir: $login_host = gethostbyaddr($login_ip);
  14. Jā bet var jau uztaisīt, ja cilvēks no viena IP atrodas lapā un protams jau ir pieskaitīts, tad no šī IP personu neskaita klāt piem 30min[gadījuma, ja lapu refresho]! Vislabakais jau ir uztaisiit, lai visiem IP, kuri ir pieskaitīti netiek par jaunu skaitīti noteiktu laika intervālu.. bet šeit bez papildus IP lista neiztikt!!!
  15. Te jau galīgi nav nekāda sakara ar php, te ir triviāls izpildes gaitas kontroles operators (IF) Jā ta jau ir, bet man galvenais, lai šis scripts nepieskaita manu IP, jo labojot lapu eju tajaa entaas reizes un testeju... liidz ar to veidojas mani entie IP, kurus man nevajag........ :('
  16. Kā izlabot scriptu, lai neņemvērā refreshu??? Citadi refreshojot lapu skaitās cipari uz priekšu..... nevar noteikt patieso apmekletāju skaitu :( <?php class acounter { var $config = array(); function acounter () { /* URL to the digitset */ $this->config['img'] = "http://sitkana.eclub.lv/*/"; /* URL to the animated digitset */ $this->config['animated_img'] = "http://sitkana.eclub.lv/*/"; /* How many digits to show */ $this->config['pad'] = 6; /* digit width and height */ $this->config['width'] = 16; $this->config['height'] = 22; /* ip blocking (true/false) */ $this->config['block_ip'] = false; /* path to ip logfiles */ $this->config['logfile'] = "count/ip.txt"; /* timeout (minutes) */ $this->config['block_time'] = 15; } function is_new_visitor() { $is_new = true; $rows = @file($this->config['logfile']); $this_time = time(); $ip = getenv("REMOTE_ADDR"); $reload_dat = fopen($this->config['logfile'],"wb"); flock($reload_dat, 2); for ($i=0; $i<sizeof($rows); $i++) { list($time_stamp,$ip_addr) = split("\|",$rows[$i]); if ($this_time < ($time_stamp+$this->config['block_time'])) { if (chop($ip_addr) == $ip) { $is_new = false; } else { fwrite($reload_dat,"$time_stamp|$ip_addr"); } } } fwrite($reload_dat,"$this_time|$ip\n"); flock($reload_dat, 3); fclose($reload_dat); return $is_new; } function read_counter_file($page) { $update = false; if (!file_exists("count/pages/$page.txt")) { $count_dat = fopen("count/pages/$page.txt","w+"); $this->counter = 1; fwrite($count_dat,$this->counter); fclose($count_dat); } else { $fp = fopen("count/pages/$page.txt", "r+"); flock($fp, 2); $this->counter = fgets($fp, 4096); flock($fp, 3); fclose($fp); if ($this->config['block_ip']) { if ($this->is_new_visitor()) { $this->counter++; $update = true; } } else { $this->counter++; $update = true; } if ($update) { $fp = fopen("count/pages/$page.txt", "r+"); flock($fp, 2); rewind($fp); fwrite($fp, $this->counter); flock($fp, 3); fclose($fp); } } return $this->counter; } function create_output($page='') { if (empty($page)) { $page = "counter"; } $this->read_counter_file($page); $this->counter = sprintf("%0"."".$this->config['pad'].""."d",$this->counter); $ani_digits = sprintf("%0"."".$this->config['pad'].""."d",$this->counter+1); $html_output = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr align=\"center\">\n"; for ($i=0; $i<strlen($this->counter); $i++) { if (substr("$this->counter",$i,1) == substr("$ani_digits",$i,1)) { $digit_pos = substr("$this->counter",$i,1); $html_output .= "<td><img src=\"".$this->config['img']."$digit_pos.gif\""; } else { $digit_pos = substr("$ani_digits",$i,1); $html_output .= "<td><img src=\"".$this->config['animated_img']."$digit_pos.gif\""; } $html_output .= " width=\"".$this->config['width']."\" height=\"".$this->config['height']."\"></td>\n"; } $html_output .= "</tr></table>\n"; return $html_output; } } ?> Kā to dabūt gatavu???? :unsure:
  17. Protams, ka skaitītājs refreshus skaita, ta ir vēlviena problēma..... Nee php logs ir cits... tas kurā rādās Da Blog Texsts!
  18. Tur jau tā lieta, ka man to konkrēto IP nevajag rakstīt faila, lai raksta pārējos!!! TAd kods buutu shaads, tikai truukst komandas, lai IP netiek ņemts vērā un netiek ierakstīts viesu IP failā!!! <?php $rip = $_SERVER['REMOTE_ADDR']; $fname = $_SERVER['PHP_SELF']; if ($rip != '159.148.123.34') { // ierakstam failā } $file1 = "HVT/ip.txt"; $open1 = fopen($file1, "r"); $size1 = filesize($file1); $count1 = fread($open1, $size1); $pos1 = strrpos($count1, '*'); $pos2 = strpos($count1, '*',$pos1-8); $count = substr($count1,$pos2+1,($pos1-$pos2)-1); $count = $count+1; fclose($open1); $today = getdate(); $time = $today['hours'].":".$today['minutes'].":".$today['seconds']; $day = $today['mday']."-".$today['mon']."-".$today['year']; $hostname = gethostbyaddr($rip); $open2 = fopen($file1, "a"); fwrite($open2, "*"); fwrite($open2, $count); fwrite($open2, "*"); fwrite($open2, $rip); fwrite($open2, "+"); fwrite($open2, $hostname); fwrite($open2, "+"); fwrite($open2, $fname); fwrite($open2, "+"); fwrite($open2, $time); fwrite($open2, "+"); fwrite($open2, $day); fwrite($open2, "\n"); fclose($open2); ?>
  19. Esmu iesācējs PHP un mēģinu kaut ko iemācīties!
  20. Jā ta jau ir, bet man galvenais, lai šis scripts nepieskaita manu IP, jo labojot lapu eju tajaa entaas reizes un testeju... liidz ar to veidojas mani entie IP, kurus man nevajag........
  21. tests neizmanto SQL datu baazi, tikai txt failu........
  22. Tu gribi teikt, ja es ielieku shaadu kodu: <?php if (55.55.55.55 != 55.55.55.55) { // ierakstam failā } ?> tad viss straadaas, nedomaaju gan.... tur truukst dazhas komandas!!! NEvari uzrakstiit tieshi pilno coda dallu???? :blink:
  23. Ir shaads scriptinsh, bet kaa lai pielieku klaat komandu, lai vienu konkreetu IP nepieskaita klaat un neieraksta txt failaa..... taa it kaa shis IP vispaar nebuutu bijis shajaa lapaa!!!!!!!!!!!!!!! ///////////////////////////////////////////////////////////////////////////////////// <?php $rip = $_SERVER['REMOTE_ADDR']; $fname = $_SERVER['PHP_SELF']; $file1 = "HVT/ip.txt"; $open1 = fopen($file1, "r"); $size1 = filesize($file1); $count1 = fread($open1, $size1); $pos1 = strrpos($count1, '*'); $pos2 = strpos($count1, '*',$pos1-8); $count = substr($count1,$pos2+1,($pos1-$pos2)-1); $count = $count+1; fclose($open1); $today = getdate(); $time = $today['hours'].":".$today['minutes'].":".$today['seconds']; $day = $today['mday']."-".$today['mon']."-".$today['year']; $hostname = gethostbyaddr($rip); $open2 = fopen($file1, "a"); fwrite($open2, "*"); fwrite($open2, $count); fwrite($open2, "*"); fwrite($open2, $rip); fwrite($open2, "+"); fwrite($open2, $hostname); fwrite($open2, "+"); fwrite($open2, $fname); fwrite($open2, "+"); fwrite($open2, $time); fwrite($open2, "+"); fwrite($open2, $day); fwrite($open2, "\n"); fclose($open2); ?> //////////////////////////////////////////////////////////
  24. Jaa saprotu, bet apskatiiji lapu http://sitkana.eclub.lv ???? Garumziimes citur raadaas, tikai ne PHP logaa :(
×
×
  • Create New...