I have a form in my index.html
that looks like this:
<
Basically there is no "easy" way to do that, you need to write some code in your script that will decide what function to call and when, like:
if($_POST['submit'){
postData();
}
Another option is to use one of the many MVC framework out there like Codeigniter or laravel.
you can also make your action
like this:
<form name="form" method="post" action="send.php?postData">
and in your send.php
you can do this:
if(isset($_GET['postData'])){
postData();
}
Add a unique hidden field in your form like:
<input type="hidden" name="action" value="postData" />
send.php
<?php
function generatekey () {
// action
}
function postData() {
// action
}
if ( $_POST[ 'action' ] == 'postData' ) {
postData();
}
?>
Or read your submit value, if it's unique.