# Cant make simple contact form work..?

**URL:** <https://forum.kirupa.com/t/cant-make-simple-contact-form-work/321975>\
**Category:** programming\
**Created:** [May 6, 2011, 2:32am UTC](https://forum.kirupa.com/t/cant-make-simple-contact-form-work/321975 "2011-05-06T02:32:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![djsquare214](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@djsquare214](https://forum.kirupa.com/u/djsquare214)\
**Post date:** [May 6, 2011, 2:32am UTC](https://forum.kirupa.com/t/cant-make-simple-contact-form-work/321975/1 "2011-05-06T02:32:27Z")

</div>

Cant get it to work, im using dreamweaver. here is my php:

\<?PHP  
$to = “[e-bayd2@live.ca](mailto:e-bayd2@live.ca)”;  
$subject = “Results from your Request Info form”;  
$headers = “From: Form Mailer”;  
$forward = 0;  
$location = “”;  
$date = date (“l, F jS, Y”);  
$time = date (“h:i A”);

$msg = "Below is the result of your feedback form. It was submitted on $date at $time.

“;  
if ($\_SERVER[‘REQUEST\_METHOD’] == “POST”) {  
foreach ($\_POST as $key =\> $value) {  
$msg .= ucfirst ($key) .” : ". $value . "  
“;  
}  
}  
else {  
foreach ($\_GET as $key =\> $value) {  
$msg .= ucfirst ($key) .” : ". $value . "  
";  
}  
}  
mail($to, $subject, $msg, $headers);  
if ($forward == 1) {  
header (“Location:$location”);  
}  
else {  
echo “Thank you for submitting our form. We will get back to you as soon as possible.”;  
}  
?\>

Here is my HTML for the form:

\<form action=“mailer.php” method=“post”\>  
\<p\>Your Name:  
\<input type=“text” name=“test”\>\<br\>  
Your Email: \<input type=“text” name=“email”\>  
\</p\>  
\<p\>\<br\>  
Your Message:\<br\>  
\<textarea name=“message” rows=“5” cols=“30”\>\</textarea\>  
\<br\>  
\<input type=“submit” name=“submit” value=“Submit”\>  
\</p\>  
\</form\>

thanks for your help on this one!
