How to change contact form

2 replies · opened Sep 6, 2017

Rrobites9Sep 6, 2017

Hello guys,
I wanted to know if you can change a contact form.
Can I insert or delete a field in html?
and then how do I manage the php files attached to it?

See the .jpg attachment.

Thank you for the reply

SSemicolon WebSTAFFSep 7, 2017

Hello,

This is Definitely Possible! There are 3 Steps to configure a New Field in the include/sendemail.php File:

  1. Find the following code and duplicate it to add the New Field:
$name = isset( $_POST['template-contactform-name'] ) ? $_POST['template-contactform-name'] : '';

Example:

$newfield = isset( $_POST['template-contactform-newfield'] ) ? $_POST['template-contactform-newfield'] : '';

Make sure that the template-contactform-newfield is same as the Form Input’s name attribute in the HTML.

  1. Now, find the following code just a few lines below and duplicate it to add the New Field:
$name = isset($name) ? "Name: $name

" : '';

Example:

$newfield = isset($newfield) ? "New Field: $newfield

" : '';
  1. You now simply need to Add the New Field to the following code:
$body = "$name $email $phone $service $message $referrer";

Example:

$body = "$name $email $phone $newfield $service $message $referrer";

This will definitely work fine.

Hope this Helps! Do let us know if we can help you with anything else or if you find any further issues with Canvas.

Rrobites9Sep 8, 2017

Perfect, I try as you suggest,
thank you very much.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard