Well - two common ways this can be done:
1) make this a <form> and point your submit event to a php file
2) create an AJAX call that targets a php function.
If you don't know how to do these things, go
here [
^] and learn appropriate protocol for the method you prefer. (form or AJAX).