Run a File From Button Click
Total Size: 2.26 KB
Created: 2 years ago
Edited: 2 years ago
So you have your buttons right, I am guessing they are inside of some HTML form?
If not, then you will need to in order to fire a GET or POST request, here is an example of a GET form:
<form action="/action_page.php" method="get"> <input type="submit" value="Button 1"> </form>
Now, when clicking the submit button on the form, it will send of a GET request. In order to change it to a POST request, you change the method to 'POST' like so:
<form action="/action_page.php" method="post"> <input type="submit" value="Button 2"> </form>
You can make things more complex by using Ajax to send off a request in the background and not let the page be refreshed but I think you want it kept simple for now.
Here are some links you should look at and read:
And some more info on Switch statements:
Are you sure you want to delete?