WordPress is designed in such a way that PHP code will not be executed when it is placed in posts and pages. Exec-PHP plugin lets you execute PHP code in a page or a post by allowing the user to tick a checkbox (when writing or editing a post) to indicate that there is PHP code in that post/page that is to be run.

http://bluesome.net/post/2005/08/18/50/