PHP Script for Contact Form not working in CMSMS
Posted: Wed Jan 25, 2012 8:19 pm
Had a site hosted by GoDaddy and this script worked along with the html version of the site. Since I've transferred it over to CMSMS (1.10.3) it no longer works. Am I missing something in my code? Server is running PHP5.3 - Thanks for the help and I apologize for my lack of knowledge.
html site:
PHP Script:
html site:
Code: Select all
<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>
Code: Select all
<?php
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$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 .= “Name: <b>” . $name . “</b><br>”;
$content .= “Email: <b>” . $email . “</b><br>”;
$content .= “Phone: <b>” . $phone . “</b><br>”;
$content .= “Company: <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>