wrap javascript in php to make header work