I wonder if it is possible to use a single PHP file which is declaring all necessary functions instead of creating a unique file for every one.
For example, i’ve got a form which submits a text to phpscript.php. Another form is sending a date. I would do this like this:
<form id="text" method="post" action="textscript.php">
<textarea name="text"></textarea>
</form>
<form id="editForm" method="POST" action="datescript.php">
<input name="date" type="date" /><br />
<input id="submitDate" type="submit" /><br />
</form>
Now i would like to declare functions.php, which contains both procedures and then use this file for form action. I have just no idea idea how to achieve this as well as i already tried to give an URL-Parameter.
You could look into the Front Controller Pattern to dispatch “function calls”.