InlineJS (PHP but it's JS)
InlineJS lets you have server-side code in html.
There is an example in the code.
Also sorry if you dont understand, i'm not good at explaining :/
Please give me feedback in the comments :)