PHP:
<?php
/*
*/
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "
[email protected]" ;
$mailto = '
[email protected]' ;
// $subject - set to the Subject line of the email, eg
//$subject = "Broken Link Form" ;
$subject = "Broken Link Form" ;
// the pages to be displayed, eg
//$formurl = "http://www.example.com/error404.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "http://www.corradocomputers.com/error404.html" ;
$errorurl = "http://www.corradocomputers.com/error.html" ;
$thankyouurl = "http://www.corradocomputers.com/thankyou_broken_link.html" ;
$uself = 0;
$broken_link_url_is_required = 1;
$name_is_required = 1;
$use_utf8 = 1;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ;
$name = $_POST['name'] ;
$broken_link_url = $_POST['brokenlink'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['brokenlink'])) {
header( "Location: $formurl" );
exit ;
}
if (($email_is_required && (empty($email) || !ereg("@", $email))) || ($name_is_required && empty($name))) {
header( "Location: $errorurl" );
exit ;
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}
if (empty($broken_link_url)) {
$broken_link_url = $mailto ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $name\n" .
"Broken Link/URL: $broken_link_url\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper,
"From: \"$name\" <$broken_link_url>" . $headersep . "Reply-To: \"$name\" <$broken_link_url>" . $headersep . "X-Mailer: chfeedback.php 2.11.0" .
$headersep . 'MIME-Version: 1.0' . $headersep . $content_type );
header( "Location: $thankyouurl" );
exit ;
?>
**********
**********
**********
Html scripting:
<form action="notfound.php" method="post">
<p class="style10">The page you are looking for is not available.</p>
<p class="style10">Please help us correct this problem by filling out the form below:</p>
<table border="0" align="center" cellpadding="8" cellspacing="8" summary="brokenlink form">
<tr>
<td width="132">Name:</td>
<td width="401"><input type="text" name="name" size="65" /></td>
</tr>
<tr>
<td>Current URL:</td>
<td><input type="text" name="brokenlink" size="65" /></td>
</tr>
<tr>
<td colspan="2"> Comments (How did you get here?):<br />
<br />
<textarea rows="5" cols="69" name="comments"></textarea>
</td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" value="Send Feedback" />
<br />
</td>
</tr>
</table>
</form>