So I created a Contact Us page and for some reason my contact.php script isn't sending anything back to me.
PHP 5.3 on my server fyi
Contact.html
The code doesn't open with <? since it's created in Coda. Should I change this? If so I get red text on a lot of the commands.
Contact.php:
PHP 5.3 on my server fyi
Contact.html
Code:
<section id="content">
<article>
<h2>Contact <span>Form</span></h2>
<form id="contacts-form" action="contact.php" method="post">
<fieldset>
<div class="field">
<label>Name:</label>
<input type="text" value="" name="Name" />
</div>
<div class="field">
<label>E-mail:</label>
<input type="text" value="" name="E-mail" />
</div>
<div class="field">
<label>Phone:</label>
<input type="text" value="" name="Phone" />
</div>
<div class="field">
<label>Company:</label>
<input type="text" value="" name="Company" />
</div>
<div class="field">
<label>Message:</label>
<textarea></textarea>
</div>
<div><a href="thankyou.html" onclick="document.getElementById('contacts-form').submit()">Send Your Message!</a></div>
</fieldset>
</form>
</article>
</section>
</div>
</div>
</div>
</div>
The code doesn't open with <? since it's created in Coda. Should I change this? If so I get red text on a lot of the commands.
Contact.php:
Code:
<?php
$name = $_POST['name'];
$email = $_POST['e-mail'];
$phone = $_POST['phone'];
$company = $_POST['company'];
$your_message = $_POST['message'];
$headers .= ‘Content-type: text/html; charset=iso-8859-1′;
$content = “<html><head><title>Contact letter</title></head><body><br>”;
$content .= “Company: <b>” . $name . “</b><br>”;
$content .= “Name: <b>” . $email . “</b><br>”;
$content .= “Phone: <b>” . $phone . “</b><br>”;
$content .= “E-mail: <b>” . $company . “</b><br><hr><br>”;
$content .= $your_message;
$content .= “<br></body></html>”;
$mail_to = 'info@mycompany.com';
$subject = 'Message from a site visitor '.$field_name;
mail($recipient,$subject,$content,$headers);
?>
<html>
<body bgcolor=”#282E2C”>
<div align=”center” style=”margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold”>
Your message was sent. Thank you.
</div>
</body>
</html>
<script>resizeTo(300, 300)</script>
Last edited: