Reply to Re: How do I limit my number of PHP hits per second?

Your name:

Reply:


Posted by Nu on 02/01/07 06:57

"Manish" <yehaimanish@gmail.com> wrote in message
news:1170310678.143555.270740@v33g2000cwv.googlegroups.com...
>
> $currentmin = mktime(date("H") , date("i"), 0, date("m"), date("d"),
> date("Y"));
>
> if(is_file($currentmin)) {
>
> /*
> get the content of the file
>
> if content of file > 10 (max limit per minute)
> display some message/redirect ...
>
> else
> increment the value of the content read from the file and write it
> back to the file
>
> process MySQL operations ...
>
> */
>
>
> } else {
> //create a file $currentmin
>
> //write the content "1" to the file
>
> }
>
>
> //you will need to delete the older $currentmin files by some scripts







That idea will work. Thanks.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация