Help adding fields to Vossen Bootstrap theme contact form

Open
Documentation Documentation October 22, 2019
Login to reply
Tim Wojtyniak
5 years ago

The error appears to have been caused on the (hosted) server in some way. They whitelisted my IP, but I don't understand how that was causing only some fields to throw the Undefined index "Notice". Even thought it was a notice and not an error, the variable data was not being passed for the fields that threw a notice.

No explanation from them, but it got resolved. Hopefully this helps someone else in a similar situation. Better yet, I hope it doesn't happen to anyone else.

I am very grateful for a well organized and well documented template so that I could zero in on potential areas for investigation. It is also very nice that the contact form is ready to go and very, very nice how it presents an attractive "success" indicator. Many templates leave the functionality behind the contact form up to the buyer. 

Tim Wojtyniak
5 years ago

I am trying to add some fields to the contact form in the  Vossen Bootstrap theme but am getting errors:

Notice: Undefined index: company in /home/thefield/public_html/cpsbeta/php/contact-form.php on line 17

My code in index.html:

 <input name="name" type="text" id="name" placeholder="Name"/>

<input name="company" type="text" id="company" placeholder="Company"/>

 <input name="email" type="text" id="email" placeholder="Email"/>

And I added company in contact_form.php:

$name = $_POST['name'];

$company = $_POST['company'];

$email = $_POST['email'];

Sorry if the answer is obvious, but I am baffled here. What am I missing?


Tim