created client-side script to handle and send data to server