Scripting Fun :: Automatic Next Meeting Date Calculation

OK. I have finally taken the time to hack together a block for automatically stating the Next PHP Meeting date. What I needed was a way to get the third Saturday of the current month unless it has already past. Then it would get the third Saturday of next month.

If you want to have some fun with a nice academic exercise, read the article and start hacking!

The “algorithm” I hacked together was:
[code]
$t=getdate();
$today = mktime(0,0,0,$t['mon'],$t['mday'],$t['year']);

$this_month_start = mktime(0,0,0,$t['mon'],1,$t['year']);
$next_month_start = mktime(0,0,0,$t['mon']+1,1,$t['year']);

$this_month_date = strtotime("Third Saturday",$this_month_start);
$next_month_date = strtotime("Third Saturday",$next_month_start);

if($today <= $this_month_date) {
$event_date = $this_month_date;
} else {
$event_date = $next_month_date;
}
print "Saturday, ".date('F dS, Y',$event_date)." 2:30pm";
?>[/code]

Now make me proud and post your improvements.

Happy Hacking!!

HTML Purifier

Do you offer HTML input on your website or blog? Are you nervous about XSS (Cross-Site Scripting) vulnerabilities; or even more concerning–are you unsure what they are? Does it frustrate you when your users continue to use depricated tags like center in their posts?

Well, be troubled no more. Check out the HTML Purifier today. Now in version 2.0: tidy and tag extensibility!

Get your HTML Purifier today and code safer!

Security From The Inside

This interview with Stefan Esser was recently posted on Security Focus.

Stefan Esser is the founder of both the Hardened-PHP Project and the PHP Security Response Team (which he recently left). Federico Biancuzzi discussed with him how the PHP Security Response Team works, why he resigned from it, what features he plans to add to his own hardening patch, the interaction between Apache and PHP, the upcoming “Month of PHP bugs” initiative, and common mistakes in the design of well-known applications such as WordPress.

Full Interview via Security Focus –>

Check your PHP code with unit tests

This article covers installation and use of the PHPUnit2 pear module, and discusses how to test your applications at the module, DB and interface level. This is a good read, especially for those of you who must deploy tested, solid applications.

http://www-128.ibm.com/developerworks/opensource/library/os-php-unit/

PHP Encryption for mere mortals

I’ve really been loving IBM DeveloperWorks lately! Here’s another great PHP tutorial!

The author provides a quick primer on information security and cryptography, then jumps right into applying it to PHP with some very useful advice on proper implementation. Several code examples and a good number of external links are also provided.

http://www-128.ibm.com/developerworks/opensource/library/os-php-encrypt/?ca=dgr-lnxw97PHP-encrypt

Zend Framework available for download!

Zend Framework is a high quality and open source framework for developing Web Applications and Web Services.

Built in the true PHP spirit, the Zend Framework delivers ease-of-use and powerful functionality. It provides solutions for building modern, robust, and secure websites.

http://framework.zend.com/