due to the way PHP automatically makes top level variables globally accessible, it means the moment you import a script within a function, the script breaks with strange errors. I’m currently battling this in Wordpress! This post is from -- http://socoder.net/index.php?topic=2758