Hello...
I've been dealing with this script for about two days now, and I can't figure out for the life of me why it is not working.
<?php
require "config.php";
header("Expires: Mon, 20 Dec 1998 01:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$contacting_name = $_POST['contacting_name'];
$contacting_message = $_POST['contacting_message'];
$contacting_email = $_POST['contacting_email'];
$contacting_phone = $_POST['contacting_phone'];
$contacting_address = $_POST['contacting_address'];
$info_request = $_POST['info_request'];
$volunteer_request = $_POST['volunteer_request'];
$prefers_phone = $_POST['prefers_phone'];
if (!isset($_POST['contacting_email'])) {
siteheadinfo();
template_precontent();
form_top("the Miami Council for International Visitors");
echo'<tr>
<td colspan="4">Other Options:</td>
</tr>
<tr>
<td colspan="4">I would like more information about becoming a member of MCIV. <input type="checkbox" checked="checked" name="info_request" value="I would like more information about becoming a member of MCIV." /></td>
</tr>
<tr>
<td colspan="4">I would like information about volunteer opportunities with MCIV. <input type="checkbox" checked="checked" name="volunteer_request" value="I would like information about volunteer opportunities with MCIV." /></td>
</tr>
<tr>
<td colspan="4">I prefer to be contacted by telephone. <input type="checkbox" name="prefers_phone" value="I prefer to be contacted by telephone." /></td>
</tr>';
form_bottom("MCIV");
template_postcontent();
}
else {
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$mailto ="jacob@artakproductions.net";
$subject = "new e-mail from MCIV website";
$messageproper =
"This message was sent by $name:\r\n" .
"------------------------- $subject -------------------------\r\n\r\n" .
"Contact Name - $name\r\n" .
"Subject - $subject\r\n" .
"E-mail - $email\r\n" .
"$comments\r\n" .
"IP Address- $domain\r\n" .
"\r\n\r\n------------------------------------------------------------\r\n" ;
mail($mailto, $subject, $messageproper, "From: \"$contacting_name\" <$contacting_email>\nReply-To: \"$contacting_name\" <$contacting_email>\nX-Mailer: artakproductions.com automailer" );
siteheadinfo();
template_precontent();
echo'<p>Thank you for contacting us! We will try to reply to you as soon as possible.</p>';
template_postcontent();
exit ;
}
?>
It does everything it's supposed to, except for send the e-mail. I've tried it on three different hosts with no luck, both of mine and the client's hosting.
Is there any suggestions out there as to what I'm doing wrong? Heaven knows it's most likely something stupid I've overlooked, but for the life of me I haven't a clue what it is.
EDIT:
On the off chance it's something in one of the functions, here is the config.php file:
<?php
function siteheadinfo()
{
echo '<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/>
<title>MCIV || Miami Council for International Visitors</title>
<link rel="stylesheet" type="text/css" href="css.css" />
<script type="text/javascript">
if (document.images) {
menuon = new Image
menuoff = new Image
menuon.src = "images/menuon.png"
menuoff.src = "images/menuoff.png"}
function menu_highlight(something, mode)
{
something.style.backgroundImage = "url(" + (mode ? menuon.src + ")" : menuoff.src + ")");
}
</script>
<script language="javascript" type="text/javascript">
<!--
/**************************************************
Toggle visibility menu
Obtained from Ar\'tak Productions
http://www.artakproductions.com
Copyright 2004-5
Cannot be used without permission
**************************************************/
function toggleBio(objectID) {
var object= document.getElementById(objectID);
if (object.style.display ==\'block\') object.style.display=\'none\';
else object.style.display=\'block\';
return;
}
//-->
</script>
</head><body>';
}
function template_precontent()
{
require("menu.php");
echo '
<div id="container">
<table class="main">
<tr><td colspan="3" class="subhead"><div align="center"><span class="copyright">Welcome || Bienvenidos || Wilkommen</span></div></td></tr>
<tr>
<td class="logobox"><img alt="MCIV Logo" src="images/mciv.png" /></td>
<td class="head2"></td>
</tr>
<tr>
<td height="25px" colspan="2" class="subhead">
</td>
</tr>
<tr>
<td align="left" valign="top" class="menuback"> ';
template_menu();
echo ' </td>
<td valign="top" class="content"><br /> ';
}
function template_postcontent()
{
echo'
</td></tr>
<tr><td colspan="3" class="subhead"><div align="center"><span class="copyright">Miami Council for International Visitors · 2000 Ponce de Leon Blvd · Sixth Floor · Coral Gables, FL 33134</span></div></td></tr>
</table></div><div align="center"><span class="copyright2"><br />© 2005 MCIV. All rights reserved.</span></div></body></html>';
}
function form_top($addressee2){
echo '
<div align="center">
<form action="testcontact.php" method="post">
<table width="80%" class="contactform">
<tr>
<td colspan="4"><p>Contact ', $addressee2 , '</p></td>
</tr>
<tr>
<td colspan="4"><p>Please fill out all areas of the form below. All areas required unless otherwise indicated.</p></td>
</tr>
<tr>
<td class="formreq">Your Name:</td>
<td class="spacer1"></td>
<td><input name="contacting_name" type="text" width="25" /></td>
<td class="spacer2"></td>
</tr>
<tr>
<td>Your message:</td>
<td></td>
<td><textarea name="contacting_message" cols="50" rows="10"></textarea></td>
<td></td>
</tr>
<tr><td colspan="4">Contact Information:</td></tr>
<tr>
<td>Your e-mail address:</td>
<td></td>
<td><input name="contacting_email" type="text" width="25" /></td>
<td></td>
</tr>
<tr>
<td>Your phone number (optional):</td>
<td></td>
<td><input name="contacting_phone" type="text" width="25" /></td>
<td></td>
</tr>
<tr>
<td>Your mailing address (optional):</td>
<td></td>
<td><textarea name="contacting_address" cols="20" rows="3"></textarea></td>
<td></td>
</tr>';}
function form_bottom($addressee3) {
echo'
<tr>
<td colspan="2"><div align="center"><input type="submit" value="Contact ', $addressee3, '" /></div></td><td colspan="2"><div align="center"><input type="reset" value="Reset Contact Form" /></div></td>
</tr>
</table>
</form>
</div>'; }
?>
They're all basically XHTML blocks, so I'm not sure that is the problem, but who knows.