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! While you're at it, check out some resources Treehouse students have shared here.

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

PHP Build a Simple PHP Application Adding a Contact Form Working with Concatenation and Whitespace

adrien kovanic
adrien kovanic
5,727 Points

email not puping up

Hi, I put the right code :

<th>
                                <label for="email">Email</label>
                            </th>
                            <td>
                                <input type="text" name="email" id="email">
                            </td>

with the right code for the process :

<?php
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];
echo "Name: " . $name . "\n";
echo "email: " . $email . "\n";
echo "message: " . $message;

I have the title email showing but if I write in the field and send it the email field does not appear completed... Name: adrien email: message: voila mon message

thanks a lot

1 Answer

If you do something like this at the beginning of the page, can you see the email?

<?php

echo "<pre>";
var_dump($_POST);
exit;

If you can't see a key of 'email' inside the resulting dump to the screen, then something is wrong between your form submitting and getting to the processing script.

If you can see the email, something is wrong with your processing script.

You can keep pasting this code at various points in your script to find out where and when you lose the value of $email.