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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![John Lee Kien Hua](https://secure.gravatar.com/avatar/00f76c5d985b7b63472f058d013692e2?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
John Lee Kien Hua
956 Points(Solve) Build A Simple PHP Application Learning > Step 3 > Adding a Contact Form
Hi, there. I`m in learning this topic. But after I complete all the coding as Randy Hoyt provide & fill in the form. I do not get the result to contact.php?status=thanks page. It keep stuck at contact.php page with nothing change.
I just do not know what`s going on. Hope some one can provide a help, thank you.
Below is my code:
<?php
if ($_SERVER["REQEUST_METHOD"] == "POST") {
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];
$email_body = "";
$email_body = $email_body . "Name: " . $name . "\n";
$email_body = $email_body . "Email: " . "$email" . "\n";
$email_body = $email_body . "Message: " . $message;
// Todo: Send email
header("Location: contact.php?status=thanks");
exit;
}
?><?php
$section = "contact";
$pagetitle = "Contact Mike";
include('inc/header.php');
?>
<div class="section page">
<div class="wrapper">
<h1>Contact</h1>
<?php if (isset($_GET["status"]) AND $_GET["status"] == "thanks") { ?>
<p>Thanks for the email! I’ll be in touch shortly.</p>
<?php } else { ?>
<p>I’d love to hear from you! Complete the form to send me an email.</p>
<form method="post" action="contact.php">
<table>
<tr>
<th>
<label for="name">Name</label>
</th>
<td>
<input type="text" name="name" id="name">
</td>
</tr>
<tr>
<th>
<label for="email">Email</label>
</th>
<td>
<input type="text" name="email" id="email">
</td>
</tr>
<tr>
<th>
<label for="message">Message</label>
</th>
<td>
<textarea name="message" id="message"></textarea>
</td>
</tr>
</table>
<input type="submit" value="Send">
</form>
<?php } ?>
</div>
</div>
<?php include('inc/footer.php'); ?>
2 Answers
![John Lee Kien Hua](https://secure.gravatar.com/avatar/00f76c5d985b7b63472f058d013692e2?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
John Lee Kien Hua
956 PointsI just found that I wrong wrote the REQUEST_METHOD become REQEUST_METHOD. May I ask how to delete or close this topic? Thank you.
![Chase Lee](https://uploads.teamtreehouse.com/production/profile-photos/52296/micro_Untitled-1.jpg)
Chase Lee
29,275 PointsJust mark your answer as "best answer". There will be a green check mark next to your post on the forum showing that it was resolved.
![John Lee Kien Hua](https://secure.gravatar.com/avatar/00f76c5d985b7b63472f058d013692e2?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
John Lee Kien Hua
956 PointsThanks for your help, James. :)