Landing function through URL

You have a few options.


GET Parameter
The easiest one is to add a GET parameter to the url of the links, so you call it like this: domain.com/page?function=1

Then, on your page page, you can access this parameter using global array $_GET['function'] and do your logic as you wish.


POST Parameter – wrap into forms
If you don’t want it to be seen, you can wrap your links in separate form elements, with action set to domain.com/page, the link would be an input type="submit", and also add an input field type="hidden" with name="function" value="1". Then you can access this value on your page page with global $_POST['function'] array. More about forms here.


Register custom routes
You can do exactly like you wanted, accessing domain.com/page/1 can make the get_query_var('function') set to 1 on page page, but you need to register a custom url route in WordPress.

This has been answered already, so I’ll just point you to it here.


Warning
Whatever option you choose, please don’t forget to wrap the value of your parameter inside htmlspecialchars() function. More about that here.