Page 1 of 1

Saving form data to database

Posted: Mon Oct 07, 2024 7:56 pm
by krwysi
Hi I want to save form data to a database, and have filled in the info on the "advanced" section, however, when the page is published, the script still has all the email info, eg
$mailto = '';
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$subject = '';
$message = '';

Does the email info have to be completed/does the form have to be emailed as well as saved to the database? We have no need for the form to be sent by email.
Thanks.

Re: Saving form data to database

Posted: Tue Oct 08, 2024 2:03 am
by wwonderfull
If you have not the need of sending the email and only sending the data to database, then just do not use the SMTP along with the Malito option keeping them blank. But for user experience make sure to direct to the success or error page.

And make sure you have MySQL configured on the advanced form property.

You will find the database settings in Form Processing section where there is an option called Advanced.

Re: Saving form data to database

Posted: Tue Oct 08, 2024 5:59 am
by Pablo
If the Email Address field is left blank, no email will be sent. However, the 'mail' code will still be included in the script, as it's part of the generic script.