it would be better to create a plugin & make required variable global by using a global hook.
* plugin basics | * database methods | * plugin hooks
* guidance on plugins making | * plugins & hooks explained | * Plugin Authoring For Beginners
* How to make a plugin | * quick tutorial on plugins making
* advanced plugin development
* plugin basics | * database methods | * plugin hooks
* guidance on plugins making | * plugins & hooks explained | * Plugin Authoring For Beginners
* How to make a plugin | * quick tutorial on plugins making
* advanced plugin development