Jump to content

Contact form not working


Pinago

Recommended Posts

Hello,

I created a site at saintadelaide.com/testSite, and have tried several different contact form codes. Each has worked when I try the form on it's own / in it's own sample contact page, but when I add the <form>content</form> codes to my page, the "Submit" button does nothing or the emails do not arrive at their destination. I cannot see why this is happening, and my hosting server tech dept does not see why the form is not working either. Could someone please help?

 

Here is the latest contact form...

http://www.saintadelaide.com/testSite/contact.php

 

Thank you

Link to comment
Share on other sites

Here you go - 2 pages:

===

SENDEAIL.PHP PAGE

===

<!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("saintadelaide@verizon.net", $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="CONTACT_TEST/index.php">Return to St Adelaide's Homepage</a>

</p>

 

</body>

</html>

 

===

CONTACT.PHP PAGE

===

<!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: SaintAdelaide@verizon.net <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: StAdeladeRelEd@verizon.net <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 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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.