# PHP Contact form not working

**URL:** <https://forum.kirupa.com/t/php-contact-form-not-working/157737>\
**Category:** programming\
**Created:** [August 3, 2005, 11:22pm UTC](https://forum.kirupa.com/t/php-contact-form-not-working/157737 "2005-08-03T23:22:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![60Fairlane](https://avatars.discourse-cdn.com/v4/letter/6/ecc23a/32.png) [@60Fairlane](https://forum.kirupa.com/u/60Fairlane)\
**Post date:** [August 3, 2005, 11:22pm UTC](https://forum.kirupa.com/t/php-contact-form-not-working/157737/1 "2005-08-03T23:22:32Z")

</div>

This basic contact form on my web page is not working. This seems pretty basic, but for some reason it’s not sending the form. Any Help/Suggestions would be greatly appreciated - TIA.

Regards,  
Brian

Here is the form code:

[color=Blue]\<form method=“post” action=“contactme.php” \>  
\<p align=“center”\>  
\<b\>\<font size=“2” face=“Verdana”\>Name: \<input type=“text” name=“name” size=“30”/\>  
\<br\>  
\<br\>  
Phone: \<input type=“text” name=“phone” size=“30”\>  
\<br\>  
\<br\>  
Email: \<input type=“text” name=“email” size=“30”\>  
\<br\>  
\<br\>  
Message: \<textarea name=“message” cols=“30” rows=“5”\> \</textarea\>  
\<br\>  
\<br\>  
\<input type=“submit” value=“Send Form”\> \</font\>\</p\>  
\</form\>[/color]

and the PHP form code:

[color=Blue] \<?PHP  
if(isset($\_POST[‘submit’])) {  
$to = "brian@thedentistschoice.com";

$re = “Feedbackfromcontactpage”;

$name\_field = $\_POST[‘name’];  
$phone\_field = $\_POST[‘phone’];  
$email\_field = $\_POST[‘email’];  
$message = $\_POST[‘message’];

$body = "From: $name\_field  
E-Mail: $email\_field  
Message: $message  
Phone: $phone\_field  
";  
echo “Data has been submitted to $to!”;

mail($to,$re,$body);  
} else {

echo “Thank you for submitting your contact information. We will contact you as soon as possible.”;

}  
?\>[/color]
