You need to put that code in a plugin because as Lynne said you can't put php in a template. Here's the manual page for creating a plugin:
https://www.vbulletin.com/docs/html/main/add_plugin
If that script doesn't produce any output, then just putting those two lines in a plugin using hook global_start will probably be enough. If that php file produces output, then you will need to buffer the output and capture it in a string variable, then register that variable to a template, then add a tag to the template. Here's the manual page that describes including an external file that produces output:
https://www.vbulletin.com/docs/html/..._externalfiles
If that doesn't have all the info you need to figure it out, let us know.