Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Output Buffering, More Zend, and Fixing 404s
May 01, 2002 @ 11:46:29

Let the mystery surrounding output buffering be no more! Well, okay - maybe not, but at least the latest DevShed.com article will help shed some light on the matter. For those that don't know what output buffering is: PHP's output control functions provide a way for you, the developer, to exercise some degree of control over how the output generated by a particular PHP script is handled. So, basically, instead of your script just outputting things as it goes along and you having to adhere to those guidlines, you can "buffer" it and output it whenever you please. They give you some great code examples (as usual) and cover all of the major output control functions. One neat thing that they do mention is the use of output buffering to compress the output of a script and make it download faster for those on slower connections.

Also new from Zend.com today, we have the second installment in the tutorial covering Using Objects to Create an Application. Basically, this is just helping you get your mind around using object-oriented programming versus the normal, more linear programming that most people start out with. Trust me, if you haven't gotten into the obejct-oriented stuff in PHP, you're missing out. If you have places where you find yourself redefining code over and over, you seriously need to look into classes. This article talks about creating an "online posting system" for allowing registered users to post messages, to manage them, and have different levels of access for each user.

I know that everyone out there makes perfect sites 100% of the time and there's no such thing as a 404 error, right? Well, for those out there that answered "yeah, right" to that and don't live in some fantasy world, the newest article from SitePoint is for you. In "404 Errors - And 5 Ways to Avoid Them, the author points out some handly little things that you can do you help your site users get fewer 404 errors and more content out of your site including: redirecting to the main page, keeping an eye on the pages listed for your site (like on search engines), and keeping a log of the changes you make so that you know what might be causing that slew of 404 errors you've been getting. They do stress how important it is that you have something for dealing with 404 errors, even if it's just a static page - Guess what happens when the user clicks on the link? They're taken to a 404 page. Online, this is like saying "Hey thanks for trying but we don't want you here." Accordingly, the user will usually just go back to the search engine and click on the listing of one of your competitors. And just like that you've lost a potential customer.

tagged:

Link:


Trending Topics: