How do I link a php file to a react form?

I am trying to link my php file to write to my MySQL database from a js react form but it is not working. Can anyone see what I am doing wrong?

code for the javascript form

code in the php file

The form is in my main App.js in the render() function.
I want it to write to the mysql database but so far is not working