Jump to content
php.lv forumi

ainars

Reģistrētie lietotāji
  • Posts

    27
  • Joined

  • Last visited

Posts posted by ainars

  1. nu bet nomainot tikai hederi, tev nenomainiisies tie dati, kas jau ir ielikti lapaa. saskaņo charsetus tai lapai no kuras liec iekšā (administraaicija, komentāru likšana vai etc) ar lapu kuraa tev rādīsies tie dati un viss būs ok. veciem datiem jāliek vai nu konvertēšana, jāatstāj kā ir via jādzēš ārā.

    Tur jau taa lieta, ka burts "š" neattēlojas pēc hīdera izmainīšanas, kad ieliku jaunu ziņojumu :(

     

    Kas burtam "š" nepatīk???

  2. Ja tas meta tags ir pareizs, tad tas nozīmē, to, ka liekot datus iekš DB (vai teksta failiem) tiek lietots ne-Win1257 encodings. Pamēģini pārsaglabāt tos datus.

     

    btw. Par Tevi sadaļā:

    IP:

    Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/sitkana.eclub.lv/public_html/encrypt.php on line 231

    [unknown]

    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.... :(

  3. nu skaties vai pie ievades tev ir tas pats windows-1257.

    nav ne jausmas, kas ir Cutephp - ja tā ir proga, tad skaties kur ko var sakruķīt uz 1257 (gan jau ka var, ja nevar, tad nelieto), ja webisks softs, tad skaties, kāds kodējums ir lapai ar ievades formu.

    šo progu var dabūt CutePHP....

  4. ā) ports 1080 nekad netiks pārbaudīts un while pat izmetīs erroru pie x>=8

    bē) what's the point? mēģinām noteikt, vai pie tevīm saitā ienāk proksis?

    cē) tikuntā nevis $REMOTE_ADDR, bet gan $_SERVER['REMOTE_ADDR'] utml.

    Saitā šādu scriptu neizmantošu.... ieliku to tikai lai Jums būtu ko notestēt :)

  5. <?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:

  6. php logs ir šis?

     

    IP:

    Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/sitkana.eclub.lv/public_html/encrypt.php on line 235

    [unknown]

     

    :P

     

    skaitītājs tev refreshus skaita?

    Nezinu kāpēc Tev tas errors parādījās, bet.... line 235 ir:

    $login_host = gethostbyaddr($login_ip);

  7. kā tev pašam liekas kā var noteikt vai cilvēks taisa refrešu vai ievada urli ar roku? varbuut pasties kautko par kuukijiem vai sesijaam, gan jau dziivee noderees.

    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!!!

  8. 1-kārt) IP adresi ir strings! tā ir jāliek pēdiņās: '159.148.123.34'

    2-kārt) tu saproti, ko nozīmē vārdi "ierakstam failā"???? tev taču koda gabals ir, kas raksta to visu infu failā, ne? Nu tad ieliec to visu tajā(komentāra) vietā ;)

     

    Esmu iesācējs PHP un mēģinu kaut ko iemācīties!

    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........ :('

  9. 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:

  10. php logs ir šis?

     

    IP:

    Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/sitkana.eclub.lv/public_html/encrypt.php on line 235

    [unknown]

     

    :P

     

    skaitītājs tev refreshus skaita?

    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!

  11. 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);
    ?>

  12. ainars: tak ne jau konstantas IP adreses tur jāliek! mainīgos, tipa sanjemtaaIP ir tas, ko dabūt no REMOTE_ADDR, un nevajadziigaaIP ir strings, piemēram '159.148.123.34'. Un tā komentārs jau nav jāaststāj kādu es tur uzliku, bet tur jāliekt tavs koda gabals. Nu šitik elementārās lietas jau vajadzētu jēgt, tur no php specifikas gandrīz nekā nava

     

    o2T: vai tad kāds apgalvoja, ka salīdzināšana ir viena = ?

    Esmu iesācējs PHP un mēģinu kaut ko iemācīties!

  13. 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);

    ?>

    //////////////////////////////////////////////////////////

×
×
  • Create New...