Hi, I am using a contact form php code found online and it's working as a separate form in it's own page, but when I add it to my page it does not work...
Can anyone see an obvious reason why it wouldn't work? The "Send" button does nothing... My hosting service does not see why it's not working either.
Here is the code I used, as it appears inside the pages, and the page link is:
http://saintadelaide.com/testSite/
=== CONTACT.PHP ===
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Welcome to Saint Adelaide Parish, Peabody, Mass: www.SaintAdelaide.com</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body onload="MM_preloadImages('images/button1under.gif','images/button2under.gif','images/button3under.gif')">
<div id="wrapper">
<div id="threeButtons">
<div style="width:301px; height:62px; margin:0 0 0 25px; float:left;"><a href="masstimes.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('button1','','images/button1under.gif',1)"><img src="images/button1over.gif" alt="Mass Times at Saint Adelaide's" name="button1" width="301" height="62" border="0" id="button1" /></a></div>
<div style="width:301px; height:62px; margin:0 0 0 13px; float:left;"><a href="religious-ed.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('button2','','images/button2under.gif',1)"><img src="images/button2over.gif" alt="Religious Ed at Saint Adelaide's" name="button2" width="301" height="62" border="0" id="button2" /></a></div>
<div style="width:301px; height:62px; margin:0 0 0 12px; float:left;"><a href="http://seekandfind.com/directory/st.-adelaide-church_2141.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('button3','','images/button3under.gif',1)"><img src="images/button3over.gif" alt="Download Parish Bulletin" name="button3" width="301" height="62" border="0" id="button3" /></a></div></div>
<div id="mainMenu">
<ul>
<li><a href="about.php">ABOUT</a></li>
<li><a href="register.php">REGISTER</a></li>
<li><a href="youth.php">YOUTH</a></li>
<li><a href="groups.php">GROUPS</a></li>
<li><a href="events.php">EVENTS</a></li>
<li><a href="contact.php">CONTACT</a></li>
<li><a href="index.php">HOME</a></li>
</ul>
</div>
<div id="bodyWrapper2">
<div class="bcont">
<div class="tcont">
<div class="pageTitle" id="interior_heading"> Parish Contact</div>
<div id="interior_text"><p>Reverend Raymond Van De Moortell<br />
Reverend David C. Lewis<br />
<br />
St. Adelaide's Parish Center<br />
712 Lowell Street<br />
Peabody, MA 01960 <br />
<br />
Parish Center Office 978 535-1985<br />
Parish Center Fax 978 535-4845<br />
Email: example@example.com <br />
Hours: Mon-Fri - 9:30 am to 4:00 pm<br />
<br />
Religious Education Administrator: Elizabeth Harnois <br />
<br />
Religious Education Coordinators:<br />
Michelle D'Amato, Angela Federico, Denise Gianola <br />
<br />
Religious Education Office Phone 978-535-5376 <br />
Email: example@example.com <br />
<br />
Secretary Marie Capillo<br />
Property Manager Dan Sweeney<br />
<br />
<span class="reledheading">Please use the contact form below or email us:</span></p>
<div style="padding:5px 0 0 10px;>
<form method="post" action="sendeail.php">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
Full Name<br />
<input type="text" name="visitor" size="35" />
<br />
Phone#<br />
<input type="text" name="visitormail" size="35" />
<br />
Email<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
<br />
Attention<br />
<select name="attn" size="1">
<option value=" Attention Parish Office ">Parish Office </option>
<option value=" To Rev. David Lewis ">Message to Rev. David Lewis </option>
<option value=" To Rev. Raymond Van de Moortell ">Rev. Raymond Van de Moortell </option>
<option value=" To Parish Facilities Mgr ">To Parish Facilities Mgr </option>
<option value=" To Webmaster ">To Webmaster </option>
</select>
<br /><br />
Comments
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
</form>
</div>
</div>
</div>
<div class="clr"></div>
<div id="interiorFooter"><p>Copyright 2010 Saint Adelaide Parish | www.SaintAdelaide.com | Site designed by a parishioner</p></div>
</div>
</div>
</body>
</html>
=== SENDEAIL.PHP ===
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];
if (eregi('http:', $notes)) {
die ("Do NOT try that! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! ");
}
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
mail("example@example.com", $subject, $message, $from);
?>
<p align="center">
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?>
<br /><br />
<a href="index.php">Return to St Adelaide's Homepage</a>
</p>
</body>
</html>