Create dynamic variables

Indeed, the way to do it, is to define a specific URL that when called will call the reboot function (a custom page handler in the web server config). In your htlml you cable your button as link to that URL. When you click the link it will call the new page that you defined and that in fact just call the reboot function.