Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

David Burns
5,560 Pointscontact-process.php
I am having some trouble identifying a syntax issue while coding the php code for the contact form. This is what my browser displays: Notice: Undefined index: name in B:\xampp\htdocs\shirts4mike\contact-process.php on line 5
Notice: Undefined index: email in B:\xampp\htdocs\shirts4mike\contact-process.php on line 6
Name: Email: Message:The is a message from me!
5 Answers

aduratomi okiji
2,561 PointsMay i see you source code?

aduratomi okiji
2,561 PointsIn your contact.php code you should the name attribute in your input fields like this <input type ="text name = "name" id="name"> This will enable the post array to reference the name input when you call the $_POST["name] function

aduratomi okiji
2,561 PointsIn your contact.php code you should the name attribute in your input fields like this <input type ="text name = "name" id="name"> This will enable the post array to reference the name input when you call the $_POST["name] function

David Burns
5,560 PointsLike how? I don't your example on either post. Also, this is happening to the email section of the document too. I assume by applying your example would enable the $_POST["email"] as well? Thank you for your help greatly appreciated!

aduratomi okiji
2,561 PointsYes so it would be <input type="text" id="email" name="email"> replace every text field that is like that and it should work

David Burns
5,560 PointsI understand but could you provide me an example?

aduratomi okiji
2,561 Pointswhat do you mean?

David Burns
5,560 Pointsyou wrote this on a reply: In your contact.php code you should the name attribute in your input fields like this This will enable the post array to reference the name input when you call the $_POST["name] function. You said "you should the name attribute in your input fields like this" but didn't provide the example. I am a beginner to Php so any help would be great.
David Burns
5,560 PointsDavid Burns
5,560 Pointscontact.php code: <?php $pageTitle = "Contact Mike"; $section = "contact"; include('inc/header.php'); ?>
<?php include('inc/footer.php') ?>
contact-process.php code: <pre><?php