php-general Digest 12 Apr 2013 18:34:18 -0000 Issue 8193
Topics (messages 320836 through 320840):
Re: [ask] convert unknown format Japanese string to readable string
320836 by: Morning Star
Detecting massive web hits
320837 by: Angela Barone
320838 by: Samuel Lopes Grigolato
320839 by: Sebastian Krebs
320840 by: Frank Arensmeier
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
It works!
Thanks, Koyama! :)
On Thu, Apr 11, 2013 at 8:54 AM, KOYAMA Tetsuji <koy...@hoge.org> wrote:
> Hi,
>
> On Thu, Apr 11, 2013 at 5:39 PM, Morning Star
> <morning.star.c...@gmail.com> wrote:
>> Hi guys,
>>
>> i have a string like this:
>> $string = \u3053\u3093\u306b\u3061\u306f\u30ef\u30fc\u30c9
>> (Japanese words that say "hello world" in English)
>> How can I convert that $string to Japanese character?
>> It should be こんにちは世界
>
> I found tips in the stackoverflow.
>
> http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha
>
> I try it.
>
> <?php
> $str = "\u3053\u3093\u306b\u3061\u306f\u30ef\u30fc\u30c9";
>
> function replace_unicode_escape_sequence($match) {
> return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
> }
> $str = preg_replace_callback('/\\\\u([0-9a-f]{4})/i',
> 'replace_unicode_escape_sequence', $str);
> var_dump($str);
>
>
> Then it displays:
> string(24) "こんにちはワード"
>
> regards,
>
> --
> KOYAMA Tetsuji
> koy...@hoge.org
--- End Message ---
--- Begin Message ---
Does anyone know if there's a ready-made script that detects if someone
hits multiple web pages within seconds of each other and then can temporarily
ban them by IP from accessing our site?
Looking through the logs, I see someone/something hit each and every
page of a site I work on within only a few seconds of each other. I seriously
doubt they are a customer. ;)
I'd appreciate any insights.
Thank you,
Angela
--- End Message ---
--- Begin Message ---
I don't know exactly how search engine spiders work, but just be cautious
to not block these "users", they aren't customers but they may bring you
some =).
Again, I don't know if this is your case, but the possibility sparked on my
mind anyway.
Cheers.
On Fri, Apr 12, 2013 at 12:23 PM, Angela Barone <ang...@italian-getaways.com
> wrote:
> Does anyone know if there's a ready-made script that detects if
> someone hits multiple web pages within seconds of each other and then can
> temporarily ban them by IP from accessing our site?
>
> Looking through the logs, I see someone/something hit each and
> every page of a site I work on within only a few seconds of each other. I
> seriously doubt they are a customer. ;)
>
> I'd appreciate any insights.
>
> Thank you,
> Angela
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Nginx has builtin support for this and I assume, that there is something
similar for Apache. I don't think PHP is the right tool.
Am 12.04.2013 17:24 schrieb "Angela Barone" <ang...@italian-getaways.com>:
> Does anyone know if there's a ready-made script that detects if
> someone hits multiple web pages within seconds of each other and then can
> temporarily ban them by IP from accessing our site?
>
> Looking through the logs, I see someone/something hit each and
> every page of a site I work on within only a few seconds of each other. I
> seriously doubt they are a customer. ;)
>
> I'd appreciate any insights.
>
> Thank you,
> Angela
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
12 apr 2013 kl. 17.23 skrev Angela Barone:
> Does anyone know if there's a ready-made script that detects if someone
> hits multiple web pages within seconds of each other and then can temporarily
> ban them by IP from accessing our site?
>
> Looking through the logs, I see someone/something hit each and every
> page of a site I work on within only a few seconds of each other. I
> seriously doubt they are a customer. ;)
>
> I'd appreciate any insights.
>
> Thank you,
> Angela
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Maybe Fail2ban is what you are looking for?
http://www.fail2ban.org/wiki/index.php/Main_Page
/frank
--- End Message ---