<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>php - Slepi.NET</title>
    <link>http://slepi.net/archives/tag/php</link>
    <pubDate>Thu, 20 Nov 2008 21:36:17 -0600</pubDate>
    <description>RSS feed for entries tagged as php on Slepi.NET</description>
    <copyright>Copyrights 2008 Wiras Adi</copyright>
    <image>
      <url>http://www.slepi.net/images/slepinet-rss.png</url>
      <title>php - Slepi.NET</title>
      <link>http://www.slepi.net</link>
    </image>
    <item>
      <title>Invalidate Smarty Cache Using Cache Dependency Files</title>
      <link>http://slepi.net/entry/invalidate_smarty_cache_using_cache_dependency_files</link>
      <description>&lt;p&gt;&lt;a href="http://smarty.php.net" title="Smarty" onclick="window.open(this.href);return false" onkeypress="window.open(this.href);return false" rel="nofollow external"&gt;Smarty&lt;/a&gt; is perhaps the most powerful and widely used &lt;abbr title="PHP: Hypertext Preprocessor"&gt;PHP&lt;/abbr&gt; template engine available for PHP-based application developments. Though its usage has now been a bit pulled-aside by the rise of more advance frameworks such as &lt;a href="http://www.drupal.org" title="Drupal" onclick="window.open(this.href);return false" onkeypress="window.open(this.href);return false" rel="nofollow external"&gt;Drupal&lt;/a&gt; or &lt;a href="http://www.cakephp.org" title="CakePHP" onclick="window.open(this.href);return false" onkeypress="window.open(this.href);return false" rel="nofollow external"&gt;CakePHP&lt;/a&gt;, which come with their own template system implementations, for a "bare" template engine Smarty is still the favorite. I myself still use the combination of Smarty and &lt;a href="http://pear.php.net" title="PEAR" onclick="window.open(this.href);return false" onkeypress="window.open(this.href);return false" rel="nofollow external"&gt;PEAR&lt;/a&gt; (PHP Extension and Application Repository) for most of my PHP projects.&lt;/p&gt;
&lt;p&gt;Taking it more than just a template engine, Smarty provides a built-in caching functionality. Smarty caches the server response, and that is in pure HTML. This is nice in the term of performance, especially for an extensive script-processing generated page (ie. script that does several database queries). As long as the cache hasn't been invalidated, in subsequent request of the page Smarty will simply return the pure &lt;abbr title="Hypertext Markup Language"&gt;HTML&lt;/abbr&gt; cache instead of executing the script every time.&lt;/p&gt;</description>
      <pubDate>Sun, 09 Mar 2008 20:15:54 -0500</pubDate>
      <guid>http://slepi.net/entry/invalidate_smarty_cache_using_cache_dependency_files</guid>
      <author>wiras@slepi.net (Wiras Adi)</author>
    </item>
    <item>
      <title>Simple Text-based CAPTCHA Implementation</title>
      <link>http://slepi.net/entry/simple_text-based_captcha_implementation</link>
      <description>&lt;p&gt;Spambots are automated scripts that crawl on the net searching for URLs containing some kind of application forms - such as forums, guestbooks, or comment form on popular blogs -, and then automatically posting whatever its initial launcher (spammer) wants everybody to know. It usually carries commercial messages, offers, or simply just site promotions. This annoying practice has been one of the biggest problems of the Internet since the early days.&lt;/p&gt;
&lt;p&gt;There are several known ways to fight this kind of spambot, like applying moderation mechanism to allow moderators of the site doing some sort of manual checking and validation against every post submitted. Despite being an effective (yet not too efficient) way to prevent spams, there is in fact a more preferred method called &lt;acronym title="Completely Automated Public Turing test to tell Computers and Humans Apart"&gt;CAPTCHA&lt;/acronym&gt; (Completely Automated Public Turing test to tell Computers and Humans Apart). As being indicated by the word &lt;em&gt;automatic&lt;/em&gt; in the name, this &lt;abbr title="Artificial Inteligence"&gt;AI&lt;/abbr&gt;-based testing attempts to eliminate manual validations existed in a moderated system, adding a higher degree of efficiency.&lt;/p&gt;
&lt;p&gt;Different algorithms have been developed to implement CAPTCHA. The most popular one is by challenge users to rewrite a certain text or word presented as a distorted image, assuming such text will be difficult for computer to read but still recognizable to human. Another algorithm is to present users a sound and challenge them to write what they've heard. But my favorite CAPTCHA implementation is the old and simple text-based challenge. It works by asking users to answer a randomly generated question, like &lt;em&gt;"What is the color of the sky at night?"&lt;/em&gt; or simple math question like &lt;em&gt;"What is twenty divided by five?"&lt;/em&gt;. Personally I'd prefer this kind of question-answer interaction to a system that asking me to write down something it shows. It feels more "human", and it works at roughly the same security level as the other methods.&lt;/p&gt;</description>
      <pubDate>Sun, 03 Feb 2008 18:43:26 -0600</pubDate>
      <guid>http://slepi.net/entry/simple_text-based_captcha_implementation</guid>
      <author>wiras@slepi.net (Wiras Adi)</author>
    </item>
  </channel>
</rss>
