I am trying to run a function from a PHP script in the form action.
'; ?>
You need to run the function in the page the form is sent to.