View Single Post
Old 01-30-2008, 06:50 PM   #9 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

A little tip for you as well when using classes:

Try not to echo anything from your class. You should always try to make your class self-contained so that you can just drop it into a project and have it work.

If you echo something from your class then take that class and re-use it in another project that has (for example) a template engine then you would want to parse all text through your template engine rather than echo it.

So in your class above, rather than echo the visitors name, it would be better to return it, then echo it in your main script.

Just keeps everything nice, neat and tidy

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
The Following User Says Thank You to Alan @ CIT For This Useful Post:
sarmenhb (01-30-2008)