Why didn't it like the include? Did it error out?
The code looks fine to have as its own include file. Try using require_once though instead of include....this will force php to use this file (if it can't find it through include....it simple continues execution of the program) if it cant find the file using require then you will get an error.
And in regards to using <?php as opposed to <?
This is a setting within php.ini use short open tags....if it is turned on you can use <?
* You should however just start using <?php because starting in version 6 and on this feature will no longer be available