Showing 1 – 1 of 1 replies
mmoldaschl

Team I would like to add another field […]

mmoldaschl PURCHASED
8 years ago
hi team

i would like to add another field to the newsletter contact form

I have added

<input name="name1" type="text" id="name1" size="30" value="" placeholder="Please enter your name"/><p><p>

to the main page

and added

$name1 = $_POST['name1'];

to contact.php as well as

$e_reply = "NAME: $name1" . PHP_EOL ."EMAIL: $email";

But the email sent only includes the email...

any help very much appreciated!

M
ThemeGuru
ThemeGuru SELLER
8 years ago
Hi mmoldaschl,

Add this to the HTML form:

<input name="name" type="text" id="name" size="30" value="" placeholder="Please enter your name"/><p><p>

And add this to the PHP file:

$name = $_POST['name'];

if(trim($name) == '') {
echo '<div class="error_message">Attention! You must enter your name.</div>';
exit();
}

$e_reply = "Name: $name, Email: $email";

I just tested it and it looks like it doesn't work when you use the digit in the php variable. If you just use 'name' it works.

Regards