Jump to content

Write to table when user submits existing GET form


sogorman

Recommended Posts

I have an existing GET form that I use and want to write to a MYSQL table everytime a user uses that form.

<FORM ACTION="https://someurl.com" METHOD=GET>

Would the easiest to be a javascript function that uses the onclick event?

 

What would be the best way to continue to pass the user along while capturing data and writing that to a MYSQL table.

 

Thanks!

 

 

Link to comment
Share on other sites

Sounds like you haven't done this before.

 

Does your user have to login? If so, when user log's in, you should be able to get their username or id from the database.

 

If not and using method="get", then you can use :

$one_value = $_GET ['one_value'];
echo $one_value;

on your next page to collect that information for the one_value name/id in your input box.

 

To add this to the db you will need to use either and INSERT query to add a new row to the db or an UPDATE query to update an original row in the db.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.