How to activate HTML contact form in the template

How to activate HTML contact form in the template

1) In the .html file with the contact form locate the


tag. It may look something like this

<form id="form" class="contact-form">

you should add (or modify) attributes action=”contact.php” and method=”post”. The first one defines a file to be processed after the form has been submitted, and the second attribute – the data transport method. So the final result should look similar to this

<form action="contact.php" method="post" id="form" class="contact-form">

2) Now identify the inputs for the Name, E-mail and Message fields. To each of them you should add name=” ” attribute.

name=”cf_name” should be added to the Name input

name=”cf_email” – to the E-mail input

name=”cf_message” – to the Message textarea

Note, the name attributes are already defined in contact.php file, so if you’d like to use some custom names instead of cf_name, cf_email, cf_message, you need to update those also in contact.php file (2-4th lines of code)
3) Now download package and extract the contact.php file. Then place it into the folder with the .html files of your template (site). Open contact.php file with any HTML or text editor and change the email on the 6th line of code to your e-mail address

$mail_to = '';

4) That’s all, now upload the updated files to the server and test the contact form

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.