Contribute to PHP notes filtered

From: Date: Mon, 18 Sep 2006 16:48:37 +0000
Subject: Contribute to PHP notes filtered
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-32697@lists.php.net to get a copy of this message
Hello, I have spent a half hour of my working time writing a note to the PHP manual, spotting out a bug in other notes' code and writing/testing a solution. I do this often and have published many useful notes for a long time, I do it for free as my way to thank the PHP community, and I also try to publish as much code as possible. A simple search for phpContrib on google will spot some of the latest notes: http://www.google.com/search?rls=en&q=phpContrib&ie=UTF-8&oe=UTF-8 You can also see: http://esurfers.com/m-zip/ and the PHP manual page for zip http://it.php.net/manual/en/ref.zip.php The note I had written now is listed below (just to show my efforts).. My IP address is blocked, so I cannot post my note. An IP in NOT a computer! I am doing this from a dynamic IP address of a very large network of home computers. It is a cable company consumer high speed connection, a network so large it will be impossible to keep every one machine virus-free. Thousands of computer are sharing with NAT a single IP. I may understand anti-spam politics, but I have a few objections: 1) Why have you let me write for an hour to stop me at the end? Couldn't you just say my address is listed ***BEFORE*** I started wasting my time? 2) Most of the blocking lists list my IP as just "Dynamic IP", or as subject to/author of spam mailing. Don't you think this should have nothing to do with *FORM* filling. Nowhere it says *form* spamming attacks have started from this address. 3) Don't you think totally blocking an address just for being listed as a maybe-spammer is a bit too quick? Personally I'd like more 10 criminals out of jail than any innocent man inside. I do hate all forms of spamming, but maybe you could review someone's post before totally closing communications (maybe you could perform a double, more serious, SPAM Challenge) 4) What have you put a SPAM challenge for???? Maybe your SPAM challenge is too weak.. I have a library that can parse numeric values written as text (twomilliononehuindredtwentythreethousandsfivehundredandfour) quite easily (did it for fun), add it an explode($operand,..) where $operand is 'plus','minus', ...etc, or a preg_replace() for other operands and there you got the answer... Of course it must be someone targeting YOUR site, but I really think you should go towards GD2 generating a distorted GIF... Thanks, Francesco Francesco M. Munafo' PANGOO design Via Vittor Pisani 10 20124 - Milano Italy francesco@pangoo.it http://pangoo.it/ ----------------------------------------------------------------------------- The content of the note: Converting date() to the appropriate timezone. All solutions below seem to have a minor problem. date('I') will change from '0' to '1' the night (midnight) the DST starts, according to *SERVER* time. If, for instance, your server is in California and you want the time in Europe, the morning DST starts, date('I') might return '0' until 9:00AM (that is 0:00 in California) So all your users will see the wrong time for 9 hours and then the hour will change suddenly some time in the morning. Same thing happens when DST ends. So if you are converting time to some timezone, do the appropriate conversion *BEFORE* taking into account the DST hour. One example (quickly tested, not *exaustively*): <?php function my_date_default_timezone_set_int($IntTimeZone=+0) { global $g_my_date_default_timezone; $g_my_date_default_timezone=$IntTimeZone; } function my_date($Format='',$Time='') { global $g_my_date_default_timezone; if(!isset($g_my_date_default_timezone)) $g_my_date_default_timezone=+0; if($Time=='') $Time=time(); $Time+=$g_my_date_default_timezone*3600; $Legal=intVal(date('I',$Time)); $Time+=$Legal*3600; return gmdate($Format,$Time); } ?>

« previous php.mirrors (#32697) next »