Submit an Online HTML Form to Both MySQL and Email Using PHP




Learn how to submit an online HTML form to both MySQL and email using PHP. Get source code on Patreon: http://www.johnmorrisonline.com/patreon Enroll in …

Original source


20 responses to “Submit an Online HTML Form to Both MySQL and Email Using PHP”

  1. Hi John, is it possible to use your code in such a way where I'd like the user who entered their details to receive a copy of their submission? This requires the $email_address to be able to fetch the submitted data from the database and send it automatically right? I need some help on whether this is possible, if yes, how? Hope to receive your response soon. Thanks!

  2. Hi There, first off great tutorial! Just few questions i have which i am hoping you could help me with.
    On successful completion and submission of the form i am getting the following errors being displayed at the top of my index.php file

    Notice: Use of undefined constant validation – assumed 'validation' in /Applications/XAMPP/xamppfiles/htdocs/sampleWebsite/functions.php on line 24
    Warning: Illegal string offset 'status' in /Applications/XAMPP/xamppfiles/htdocs/sampleWebsite/functions.php on line 24

    Im working via localhost in XAMPP and do not have any mail support setup so i am thinking this is my problem. The data is being sent to my Database without fail.

    The second question i have is: On submission, the index.php file refreshes to the top of the page so the contact form and errors cannot be seen, i physically have to scroll down to the contact form section. Is there anyway to refresh the page on submission of the form back to the contact form itself?

    I would greatly appreciate your help!

Leave a Reply