BerlinIT
09-10-2003, 04:33 PM
It should be straight forward - i have other files almost identical that work fine... have i missed something?
(i've removed javascript form validators as its not necessary to show them here to solve the problem. it doesnt work without them eitheir)
Any suggestions would be massively appreciated. i suspect its something so small i cant see it, but its driving me bananas.
thanks
File1:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>Contact us to find out about upcoming events, to join our mailing list, to
contribute photos or other material, or for anything else that tickles your
fancy...</p>
<table>
<!-- Table 4 -->
<FORM ACTION="contactus_2.php" METHOD="post">
<TR>
<TD WIDTH='100%' class="contactheader">Name<BR>
<INPUT TYPE="text" NAME="name" SIZE="30" class="inputbox" VALUE="">
</TD>
</TR>
<TR>
<TD WIDTH='100%' class="contactheader">Email<BR>
<INPUT NAME='email' TYPE='text' class="inputbox" onBlur="MM_validateForm('from','','NisEmail');return document.MM_returnValue" VALUE='' SIZE='30'>
</TD>
</TR>
<TR>
<TD WIDTH='100%' class="contactheader">Message</TD>
</TR>
<TR>
<TD valign='top'>
<TEXTAREA COLS='45' ROWS='8' NAME='message' class="inputbox" wrap="VIRTUAL"></TEXTAREA>
</TD>
</TR>
<tr>
<TD valign='top' class="contactheader">Would you like to join our mailing list, to be notified of upcoming events?</TD>
</tr>
<TR>
<TD align="left" class="contactheader">
Yes <input name="maillist" type="radio" value="Yes" checked> No <input name="maillist" type="radio" value="No">
</TD>
</TR>
<TR>
<TD HEIGHT='20' VALIGN='bottom' align="left">
<br>
<INPUT NAME="send" VALUE="Send" TYPE="submit" class="button" onClick="validate()">
</TD>
</TR>
</form>
</TABLE>
</body>
</html>
FILE2 (contactus_2.php):
<?
Function GetMsgInfo()
{
$Name = $HTTP_POST_VARS["name"] ;
$Email = $HTTP_POST_VARS["email"] ;
$Message = $HTTP_POST_VARS["message"] ;
$MailList = $HTTP_POST_VARS["maillist"] ;
}
Function MailMsgInfo()
{
global $Name ;
global $Email;
global $Message;
global $MailList ;
$Text= "Name: " .$Name ."\n" ."E-Mail: " .$Email ."\n \n" ."Message: " .stripslashes($text) ."\n \n" ."Mail List: " .$maillist ;
$From= $Name . "<" . $Email . ">";
mail("webmessage@berlinit.com", "Sutter Cain Webmail Message", $Text, "From:" .$From );
}
Function DisplayMsgInfo()
{
global $Name ;
global $Email;
global $Message;
global $MailList ;
?>
<table>
<tr>
<td colspan="2" align="left">
<p><strong>The following details have been emailed to the Sutter Cain Crew:</strong></p>
<p><strong>Name: </strong><? echo $Name ; ?> <br>
<strong>Email: </strong><? print $Email ; ?> <br><br>
<strong>Message: </strong><? print $Message ; ?> <br><br>
<strong>Mailing List Subscription: </strong><? print $MailList ; ?> <br><br>
</p>
<p><strong>Thank you for getting in touch. We appreciate your feedback.</strong> <br><br></p>
<p align="center"><a href="nextevent.html">[ Home ]</a></p>
</td>
</tr>
</table>
<? } ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Contact Us 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<? GetMsgInfo() ;
//MailMsgInfo() ;
DisplayMsgInfo() ;?>
</body>
</html>
(i've removed javascript form validators as its not necessary to show them here to solve the problem. it doesnt work without them eitheir)
Any suggestions would be massively appreciated. i suspect its something so small i cant see it, but its driving me bananas.
thanks
File1:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>Contact us to find out about upcoming events, to join our mailing list, to
contribute photos or other material, or for anything else that tickles your
fancy...</p>
<table>
<!-- Table 4 -->
<FORM ACTION="contactus_2.php" METHOD="post">
<TR>
<TD WIDTH='100%' class="contactheader">Name<BR>
<INPUT TYPE="text" NAME="name" SIZE="30" class="inputbox" VALUE="">
</TD>
</TR>
<TR>
<TD WIDTH='100%' class="contactheader">Email<BR>
<INPUT NAME='email' TYPE='text' class="inputbox" onBlur="MM_validateForm('from','','NisEmail');return document.MM_returnValue" VALUE='' SIZE='30'>
</TD>
</TR>
<TR>
<TD WIDTH='100%' class="contactheader">Message</TD>
</TR>
<TR>
<TD valign='top'>
<TEXTAREA COLS='45' ROWS='8' NAME='message' class="inputbox" wrap="VIRTUAL"></TEXTAREA>
</TD>
</TR>
<tr>
<TD valign='top' class="contactheader">Would you like to join our mailing list, to be notified of upcoming events?</TD>
</tr>
<TR>
<TD align="left" class="contactheader">
Yes <input name="maillist" type="radio" value="Yes" checked> No <input name="maillist" type="radio" value="No">
</TD>
</TR>
<TR>
<TD HEIGHT='20' VALIGN='bottom' align="left">
<br>
<INPUT NAME="send" VALUE="Send" TYPE="submit" class="button" onClick="validate()">
</TD>
</TR>
</form>
</TABLE>
</body>
</html>
FILE2 (contactus_2.php):
<?
Function GetMsgInfo()
{
$Name = $HTTP_POST_VARS["name"] ;
$Email = $HTTP_POST_VARS["email"] ;
$Message = $HTTP_POST_VARS["message"] ;
$MailList = $HTTP_POST_VARS["maillist"] ;
}
Function MailMsgInfo()
{
global $Name ;
global $Email;
global $Message;
global $MailList ;
$Text= "Name: " .$Name ."\n" ."E-Mail: " .$Email ."\n \n" ."Message: " .stripslashes($text) ."\n \n" ."Mail List: " .$maillist ;
$From= $Name . "<" . $Email . ">";
mail("webmessage@berlinit.com", "Sutter Cain Webmail Message", $Text, "From:" .$From );
}
Function DisplayMsgInfo()
{
global $Name ;
global $Email;
global $Message;
global $MailList ;
?>
<table>
<tr>
<td colspan="2" align="left">
<p><strong>The following details have been emailed to the Sutter Cain Crew:</strong></p>
<p><strong>Name: </strong><? echo $Name ; ?> <br>
<strong>Email: </strong><? print $Email ; ?> <br><br>
<strong>Message: </strong><? print $Message ; ?> <br><br>
<strong>Mailing List Subscription: </strong><? print $MailList ; ?> <br><br>
</p>
<p><strong>Thank you for getting in touch. We appreciate your feedback.</strong> <br><br></p>
<p align="center"><a href="nextevent.html">[ Home ]</a></p>
</td>
</tr>
</table>
<? } ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Contact Us 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<? GetMsgInfo() ;
//MailMsgInfo() ;
DisplayMsgInfo() ;?>
</body>
</html>