This is perhaps a (very) silly question.
I have a php page with javascript, and further down the page I 'include' another php script that generates a series of boxes. I need to pass the id's of those boxes into the javascript that will execute on page load.
The thing is, if I 'echo' the variable required ~before~ the 'included' php script, I get an 'undefined var' error. I could write the javascript after the php 'include', but the javascript must stay in the head because it executes on load.
What obvious thing am I overlooking? This is driving me crazy.
Thanks.