You have two options:
- You can use a form, which requires that you have the
<form action="nameOfYourBackEndFile.php" method="post">
Your existing stuff in here
tags surrounding your existing code AND you need a button
type="submit" to submit the form.
Also, you need a way to identify which user this form is being filled out for. You have the
user_id in a session variable, so why not use that? Your submit button can look like this:
<button id="submit_<?php echo $_SESSION['user_id']; />" type="submit">Go</button>
See this example for more information about what you are trying to do:
How can I make, when clicking a button, send an email with the data included from the form?
PHP - Secure member-only pages with a login system
AJAX request callback using jQuery