I keep getting the error message “Missing” från this script. The web demo works, but not even the unaltered script works (ok, I altered the email so I would recieve one).
Here’s mine that is more “styled”
[code=php]<HTML>
<HEAD>
<TITLE>DEAD MAN RISING</TITLE>
<LINK REL=”stylesheet” HREF=”../style.css” TYPE=”text/css”>
<?php include “../scripts/highlight.php” ?>
<?php
$recipientname = “DMR Form Mailer”;
$recipientemail = “[email protected]”;
$subject = “DMR Form Mailer”;
$thanks = “Thank you for contacting us.<BR>We will get back to you as soon as possible.<br>”;
?>
</HEAD>
<BODY>
<TABLE HEIGHT=”100%” WIDTH=”100%” BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”0″>
<TR>
<TD ALIGN=”left” VALIGN=”top”>
<FONT>
<?php
if($_POST[‘submitform’]) {
$Name = $HTTP_POST_VARS[‘Name’];
$Email = $HTTP_POST_VARS[‘Email’];
$Comments = $HTTP_POST_VARS[‘Comments’];
// check required fields
$dcheck = explode(“,”,$require);
while(list($check) = each($dcheck)) {
if(!$$dcheck[$check]) {
$error .= “Missing $dcheck[$check]<br>”;
}
}
// check email address
if ((!ereg(“.+@.+..+”, $Email)) || (!ereg(“^[[email protected]]+$”, $Email))){
$error .= “Invalid email address<BR>”;}
// display errors
if($error) {
?>
<B>Error</B><BR>
<?php echo $error; ?><BR>
<A HREF=”#” onClick=”history.go(-1)”>Try again</A>
<?php
}
else
{
$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR;
// format message
$message = “Response for $recipientname:
Name: $Name
Email: $Email
Comments: $Comments
—————————–
Browser: $browser
User IP: $ip”;
// send mail and print success message
mail($recipientemail,”$subject”,”$message”,”From: $Name <$Email>”);
echo “$thanks”;
}
}
else {
?>
<TABLE BORDER=”0″ CELLSPACING=”0″ CELLPADDING=”0″ WIDTH=”300″>
<TR>
<TD ALIGN=”left” VALIGN=”top”>
<FONT>
Contact us for gigs, opinions and such.<BR>
Use this form or the mail adress below.<BR>
(<A HREF=”mailto:[email protected]”>[email protected]</A>)<BR>
</FONT>
<BR>
<FORM NAME=”contactform” ACTION=”<?php echo $PHP_SELF; ?>” METHOD=”post”>
<INPUT NAME=”require” TYPE=”hidden” VALUE=”Name,Email,Comments”>
<INPUT NAME=”Name” SIZE=”33″ VALUE=”Name” CLASS=”formstyle” STYLE=”filter:alpha(opacity=60)” onMouseOver=”high(this)” onMouseOut=”low(this)” onFocus=”javascript: this.select()”>
<INPUT NAME=”Email” SIZE=”33″ VALUE=”Email” CLASS=”formstyle” STYLE=”filter:alpha(opacity=60)” onMouseOver=”high(this)” onMouseOut=”low(this)” onFocus=”javascript: this.select()”>
<TEXTAREA NAME=”Comments” ROWS=”7″ COLS=”30″ CLASS=”formstyle” STYLE=”filter:alpha(opacity=60)” onMouseOver=”high(this)” onMouseOut=”low(this)” onFocus=”javascript: this.select()”>Message</TEXTAREA>
<BR>
<SPAN CLASS=”formtext”>
<INPUT NAME=”submitform” TYPE=”submit” VALUE=” Send ” CLASS=”submitstyle” STYLE=”filter:alpha(opacity=60)” onMouseOver=”high(this)” onMouseOut=”low(this)”>
<INPUT NAME=”reset” TYPE=”reset” VALUE=” Reset ” CLASS=”submitstyle” STYLE=”filter:alpha(opacity=60)” onMouseOver=”high(this)” onMouseOut=”low(this)”>
</SPAN>
</FORM>
<?php } ?>
</FONT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Any ideas?