How can I add a back button to this code so that the page generate for the error with "To protect our network from spam you are only allowed to submit this form once per visit." has a back button and so does the error page with the $error_title variable.
Part of the code is below... thanks!!!
$error_title = "Error!";
$error_msg = "You missed a required field (click 'back')";
if ($spam_lock) {
if (!$PHPSESSID) {
session_start();
}
else {
echo "
<head>
<title></title>
</head>
<body bgcolor=$bgcolor>
<center><h2><font face=$font color=$title_main_colour>Error!</h2>
<font face=$font size=$size color=$main_colour>To protect our network from spam you are only allowed to submit this form once per visit. <br>
</font>
</center>
</body>
";
exit;
}
}
else {
}
?>
<head>
<title></title>
</head>
<body bgcolor=<?echo "$bgcolor"; ?>>
<?
$count_array = 0;
do {
$r = $check[$count_array];
if(!$$r) {
echo "<center><h2><font face=$font color=$title_error_colour>$error_title</h2>";
echo "<font face=$font size=$size color=$error_colour>$error_msg</font></center>";
exit;
}
$count_array++;
} while ($count_array != count($check));
$date = date("m/d/Y H:i:s");
$traceroute = "<a href=\"http://www.above.net/cgi-bin/trace?$REMOTE_ADDR\">";
if ($REMOTE_ADDR == "") $ip = "<i> no ip </i>";
else $ip = getHostByAddr($REMOTE_ADDR);
while(list($key, $val) = each($HTTP_POST_VARS)){
$key = stripslashes($key);
$val = stripslashes($val);
$body .= "$key: $val\n";
}
mail($email,$receipt_subject,$receipt_body,"From:$owner_email");
if ($logging == "N") {
mail($owner_email,$email_subject,$body,"From:$owner_email");
}
else if ($logging == "Y") {
$body .= "\n\nUsing: $HTTP_USER_AGENT";
$body .= "\nHostname: $ip";
$body .= "\nIP address: $REMOTE_ADDR";
$body .= "\nDate/Time: $date";
mail($owner_email,$email_subject,$body,"From:$owner_email");
}
?>
<center>
<h2><font face=<? echo "$font"; ?> color=<? echo "$title_main_colour"; ?>><? echo "$success_title"; ?></h2>
<font face=<? echo "$font"; ?> size=<? echo "$size"; ?> color=<? echo "$main_colour"; ?>><? echo "$success_msg"; ?></font><br>
<font face=<? echo "$font"; ?> size=<? echo "$size"; ?> color=<? echo "$main_colour"; ?>></font>
<font face=<? echo "$font"; ?> size=<? echo "$size"; ?> color=<? echo "$main_colour"; ?>><a href="javascript:history.go(-1);">Go back</a></font>
</center>
</body>