Feedback form script in RH8
My form (see below) triggers a PHP script (see below) which is supposed to send the form data to my email address. It works perfectly in a regular web page, but when I've integrated into my WebHelp project the form fails to send anything and show a series of PHP errors (see below). I'm no PHP expert so I'd be grateful if anyone could advise me or suggest an alternative method of producing a Feedback Form in a WebHelp page.
FORM:
<form action="sendmail.php" method="post" name="Feedback" id="Feedback">
<p><strong style="font-weight: bold;">Name</strong>:<br />
<input name="name" type="text" id="Name" class="fields" size="30" />
</p>
<p><strong style="font-weight: bold;">Email</strong>:<br />
<input name="email" type="text" id="Email" class="fields" size="30" />
</p>
<p><strong style="font-weight: bold;">Phone</strong>:<br />
<input name="phone" type="text" id="Phone" class="fields" size="30" />
</p>
<p><strong style="font-weight: bold;">Firm</strong>:<br />
<input name="firm" type="text" id="Firm" class="fields" size="30" />
</p>
<p><strong style="font-weight: bold;">Comments</strong>:<br />
<textarea name="message" cols="60" rows="5"></textarea>
</p>
<p>
<input name="Clear" type="reset" class="button" value="Clear" />
<input
name="Send" type="submit" class="button" id="Send" value="Send" />
</p>
</form>
SCRIPT:
<?
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$phone = $_REQUEST['phone'] ;
$firm = $_REQUEST['firm'] ;
$message = $_REQUEST['message'] ;
$http_referrer = getenv( "HTTP_REFERER" );
$messagelayout =
"This message was sent from:\n" .
"$http_referrer\n" .
"\n" .
"\n" .
"SENDER------------------------------------------------------\n\n" .
"Name: $name\n" .
"Email: $email\n" .
"Phone: $phone\n" .
"Firm: $firm\n" .
"\n" .
"MESSAGE-----------------------------------------------------\n\n" .
$message .
"\n\n------------------------------------------------------------\n" ;
if (!isset($_REQUEST['email'])) {
header( "Location: feedback.htm" ) ;
}
elseif (empty($name) || empty($email) || empty($phone) || empty($firm) ||empty($message)) {
header ( "Location: error.htm" ) ;
}
else {
mail( me@work.co.uk, "Documentation Feedback", $messagelayout, "From: $name <$email>" ) ;
header( "Location: thanks.htm" ) ;
}
?>
ERRORS:
Warning: Undefined variable: _REQUEST in C:\Inetpub\wwwroot\Documentation (ILE)\WebHelp\Working\sendmail.php on line 2
Warning: Undefined variable: _REQUEST in C:\Inetpub\wwwroot\Documentation (ILE)\WebHelp\Working\sendmail.php on line 3
Warning: Undefined variable: _REQUEST in C:\Inetpub\wwwroot\Documentation (ILE)\WebHelp\Working\sendmail.php on line 4
Warning: Undefined variable: _REQUEST in C:\Inetpub\wwwroot\Documentation (ILE)\WebHelp\Working\sendmail.php on line 5
Warning: Undefined variable: _REQUEST in C:\Inetpub\wwwroot\Documentation (ILE)\WebHelp\Working\sendmail.php on line 6
Warning: Cannot add header information - headers already sent by (output started at C:\Inetpub\wwwroot\Documentation (ILE)\WebHelp\Working\sendmail.php:2) in C:\Inetpub\wwwroot\Documentation (ILE)\WebHelp\Working\sendmail.php on line 26
