PHP dynamic programming language

Find Broken Links Automatically

As dynamic web sites change, their links quickly become obsolete. Before users complain, or search engine indexes grow stale, professional webmasters use software to find those broken links. While free services such as W3 Validator are fine for occasional use, serious web sites require a service that does the following:

  • Runs automatically, at least once a week
  • Dives deep into your site to find all broken links
  • E-mails the errors to you immediately

LinkTiger broken link checker is the best service I’ve found. It graphically shows you exactly where your broken links are. A service such as this is great for dynamic websites, to ensure that search engines and users can see all your pages.
Linktiger.com - Broken links finding service

Why Use a PHP Framework?

At last night’s NY-PHP gathering, a fellow PHP’er and I discussed PHP frameworks. I told her I was developing an e-commerce site using Zend Framework. She replied that she’d been considering frameworks, especially Cake and Symfony, “but I’m not sure I need a framework at all. I write my own SQL; my apps work fine. What would a framework do for me?”

Setting aside the differences between PHP frameworks, I’m aware of at least 4 reasons to use them:

  1. Modular design: A home-grown application, with its ad hoc growth, can become a tangled mess that’s hard to change or enhance. Most mainstream frameworks provide a modular design that makes it easier to modify or add components.
  2. Flexible components: Sure, you can write your own authorization class in PHP, but why reinvent the wheel? The framework will provide an integrated component that handles not only your current needs, but requirements that you haven’t yet encountered (but that the framework’s community has). With a framework, chances are that you won’t have to redesign your authorization system when the users ask for something new.
  3. Best practices: As you use the framework, you’ll begin to absorb the practices and (we hope) good habits of the framework’s creators.
  4. New capabilities: Frameworks regularly add functionality to help developers implement new technology. These days, common enhancements involve AJAX and connections to the APIs of popular web service providers.

Developers may understandably wonder if mastering a framework is worth the learning curve. In my opinion, the effort to learn a framework will be repaid with applications that are well structured, flexible, and easily maintained.

My first open-source project: Mantis/400

Mantis/400 adds DB2 support to Mantis, the popular PHP-based bug tracking application. I programmed the upgrade with Ira Chandler of Curbstone Corporation, personnel from IBM and Zend, and Mantis’s Victor Boctor.

Mantis/400 runs on IBM System i (formerly AS/400), using Zend Core for i5.

Even before we got involved, Mantis supported several databases, thanks to the ADOdb Database Abstraction Library for PHP (and Python). ADOdb’s support of DB2 needed help, though, so we improved it, particularly for System i’s version of DB2.

I recommend the open-source process to anyone who enjoys learning a lot and meeting good people. Our team zestily shared knowledge and discoveries.

More information is available in Alex Woodie’s story in IT Jungle: Mantis Bug Tracker Ported to i5/OS.

PHP Security Links

These resources are a good start for anyone learning secure PHP programming practices.

  • Pro PHP Security (Chris Snyder and Michael Southwell) Comprehensive book, including secure hosting practices
  • Essential PHP Security (Chris Shiflett) Concise, clear explanation of web security concepts, teaching “filter input, escape output” clearly.
  • php|architect’s Guide to PHP Security (Ilia Alshanetsky) Contains detailed discussion of cross-site scripting (XSS) defenses
  • PHP Architect magazine’s monthly “security corner” column
  • Chris Shiflett’s PHP & Web Application Security Blog
  • PHP manual’s security page
  • Web Application Security Consortium mailing list
  • Protect Your Eyes Against Computer Vision Syndrome (CVS)

    Eye strain is a common complaint from computer users, but eyes aren’t the only part of the body that can hurt. Neck pain and backaches can also result from poor visual ergonomics.

    In my latest article, Protect Your Eyes Against Computer Vision Syndrome (CVS) (requires free registration after about May 18, 2007), I show several ways to keep your eyes comfortable at the computer.

    People who wear bifocals or trifocals should consider occupational progressive lenses, glasses that are made especially for daily computer use. These special glasses can resolve painful postural problems.

    Money-saving tip: if you need to buy special (occupational) glasses for computer use, you may not need to buy new frames. Your optician will be happy to use old frames that you might have saved from old prescriptions.

    New York Software Industry Association writes about my work with System i/PHP

    My work to foster PHP on IBM System i was noted in the Feb. 21, 2007, edition of buzz@nysia, the New York Software Industry Association’s weekly news report. I am delighted that buzz@nysia columnist Donna Bogatin chose me as a featured “mover and shaker.”

    Arrange Your Workstation to Protect Yourself Against Repetitive Strain Injury (RSI)

    If you’re reading this blog, you need to protect yourself against Repetitive Strain Injury (RSI). As we work and explore the internet, we accumulate little stresses and habits that can hurt us over time.

    MC Press just published my piece on how to arrange your computer workstation to avoid injury.

    For my research, I interviewed Steve Shostack, former ergonomics consultant to NASA, and Paul Linden, Ph.D. Paul, an aikido teacher and Feldenkrais practitioner, wrote Comfort at Your Computer. I also recommend Paul’s free e-book, Reach Out: Body Awareness Training for Peacemaking, downloadable from www.being-in-movement.com.

    Space did not permit me to write about my conversation with Mary Barbe, Ph.D., a researcher at Temple University. According to Dr. Barbe, recent human studies show that repetitive work causes the release of cytokines, proteins that trigger inflammation. The inflammation is not limited to the local area of overwork, but spreads throughout the body, potentially exacerbating conditions such as heart disease. The cytokines also help the body to rest by causing sensations of lethargy or even depression. Not good for productivity! In future articles, I will write about such hidden effects of RSI.

    Meanwhile, read how to arrange your computer workstation to avoid injury. Stay healthy!

    PHP mail() on IBM System i

    My new article about mail() is available at MC Press Online. The article covers:

    • Zend Core’s implementation of mail() for IBM System i
    • How mail() compares to packages such as PHPMailer
    • Function definition and example
    • How to configure SMTP in Zend Core
    • Overriding defaults with ini_set
    • Troubleshooting

    Read it here.

    Site Upgraded to PHP 5

    Early this week I called my web hosting provider, BlueHost, to ask to be upgraded from PHP 4 to 5. They graciously offered to move my files to a PHP 5 server at no charge. I was warned, though, that my site might be inaccessible during the move.

    Later that day, I saw that the site was running on PHP 5.

    One problem: my custom MX records, pointing to the wonderful FastMail email host, were reset to their defaults. People who wrote to me the morning of October 3 had their email bounced back to them.

    BlueHost corrected my MX records quickly once I told them. Email flowed properly within an hour or so.

    Lesson: anyone with custom MX records should, if altering web host settings, check the MX records immediately thereafter. Easy way to check: MX Lookup Utility.

    “Internet Options” Window Does Not Open

    When my friend reported that her Internet Explorer 6 browser crashed repeatedly, I suggested she delete temporary internet files by clicking Tools/Internet Options. She said, “Nothing happens when I click Tools/Internet Options.”

    Tools/Internet Options did not work. No window appeared. Other features, such as Edit/Find, also didn’t work, or didn’t work consistently. I could eventually make these windows appear by clicking various options over several minutes.

    I eventually discovered the pattern.
    No web page loaded: Tools/Internet Options & Edit/Find did not work.
    Any web page loaded: Tools/Internet Options & Edit/Find worked properly.

    My PC, which runs the same version of IE (6.0.2900.2180) and Windows (XP Service Pack 2) as my friend’s, does not show the odd behavior described above. My Internet Explorer is willing to show Internet Options and Find any time, even when no web page is loaded.

    I’m glad to have found the pattern. We can delete temporary internet files using Tools/Internet Options (after loading a web page). Still, IE’s inconsistent behavior from PC to PC puzzles me. Any explanation from my readers?