September 17th, 2008 by admin
We’re using PhpCaptcha on SWIFT to prevent bot spammers from posting to teacher’s websites. It seemed to be working well until I received a complaint about the seemingly not-so-random string of characters posted to one of our visitors. The captcha displays 5 random characters. This time they were: s,e,x,m,e. Can you believe it?

To avoid this in the future I’ve set the CAPTCHA_CHAR_SET to include only consonants. That way we wont get any REAL words by random.
Posted in SWIFT, captcha | No Comments »
September 15th, 2008 by admin
At some point during your web design/development lifetime, you’ll inevitably come across content in a table that needs to be cleaned before any css styling can be applied. This most likely happens when using tools like Microsoft Word to generate HTML content. Many web professionals use Dreamweaver’s “clean up Word HTML” feature, but it doesn’t always do the greatest job. Other products, like HTML Tidy may be too large or cumbersome for simple daily tasks.
Using Dreamweaver’s find and replace feature, you can create your own regular expressions and store them for later use. Here’s a regular expression I’ve cooked up for cleaning up these “dirty” tables:
(class="[^"]*["]|id="[^"]*["]|style="[^"]*["])|(|]*[>]|)|(\ \;)|(width=\"[0-9]+\")
This will strip a table down to it’s basic structure, removing all classes, styles, and widths.
Here’s a good tutorial about using Dreamweaver regular expressions:
http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions.html
Have any other methods for cleaning up HTML?
Posted in regular expressions, dreamweaver, code | No Comments »