454 CHAPTER 16 CHANGING THE LOOK OF (Web hosting solutions)

454 CHAPTER 16 CHANGING THE LOOK OF YOUR BLOG Safer PHP Code I mentioned earlier that if a theme requires a plug-in and that plug-in is not present, you will get errors on your blog. Sometimes, depending on the place the error occurs, your blog page may not work at all. Take a look at Figure 16-18. Here, I have disabled the RSS Link List plug-in. The error on the page is at exactly the place the plug-in template function is called. No more of the template code is executed, even though the rest of the page would have displayed correctly. Imagine if you had a call to a template function at the beginning of your theme template. The resultant page might contain a cryptic error message and nothing else! Figure 16-18. Theme template code can cause errors on your blog. There is a simple solution to this problem. PHP has a special ability to test whether a function exists. This means you can test to see if the plug-in function exists before trying to call it. If it doesn t exist, you don t call it. There will be no error, and if you write your template code carefully, there won t even be a header with nothing below it. Listing 16-13 shows the new version of the code.
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Leave a Reply