Jump to content

Writing form data to a mysql db


sws

Recommended Posts

Hi,  I've created a form with multiple drop down boxes in which users can select from the list.

Once they've done this for every selection, I need to create the submit button and write the values to the database. I'd also like to be notified via email once a user has submitted a form. Can I do both with the same submit button ?

Can anyone tell me how to do this ?
Link to comment
https://forums.phpfreaks.com/topic/26882-writing-form-data-to-a-mysql-db/
Share on other sites

Yes, you can do it. But, you need to realize that it has nothing to do with the "submit". The submit button merely submits the contents of the form in name/value pairs to the page specified in the form action tag. The page that receives the data can process it however you want.

There are many tutorials out there that can show you step-by-step how to insert the data to a database and how to send it via email.

The data in the form will be avilable in the php page receiving the data in the form $_POST[[i]fieldname[/i]. So if you have a 'name' field and the user enters 'John', then the variable $_POST[name] would be equal to 'John'

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.