title: Run PHP function on html button click
body: <p>I need to run some PHP function when a button is clicked. I know this is not supposed to be php's use, rather js should do it, but what my functions are doing in gathering data from a server when the user asks it. Specifically, it gets some user data and writes it to a file, and the user should decide what data will be gathered.<br>
  How can I do this? I saw the post <a href="https://stackoverflow.com/q/8552945/1786117">Run PHP File On Button Click</a> but I am still not sure how to use it.<br>
  I'm learning, so please don't be too harsh</p>
  
  <p>I have tried <code>onclick()</code> and all sorts of things but it didn't lead to anything useful</p>