My host doesn't allow for PHP 4 anymore and now a simple contact form I have doesn't work. I haven't been keeping up with the changes to PHP so I have no idea what changed.
I have a form using freecap verification. This is the code in the header. The form itself is standard stuff. I'm guessing it's something simple... When I hit submit it just reloads the page. No errors, nothing. It doesn't do anything.
session_start();
if($submit == 1 && !empty($_SESSION['freecap_word_hash'])) {
//Setup error variables
$feederror1 = 0;
$feederror2 = 0;
$feederror3 = 0;
$feederror4 = 0;
//Check if any of the form variables are blank
if (!$realname) {$feederror1++;}
if (!$email) {$feederror2++;}
if (!$message) {$feederror3++;}
//Email Validation
if (!$email) {$feederror2++;} //Is it empty?
//Is it in a valaid format?
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
$feederror4++;
}
//Check is the verification box is empty
if(empty($_POST['word'])) { $word_ok = "false"; }
if ($feederror1==1||$feederror2==1||$feederror3==1||$feederror4==1||$word_ok=="false") {
//We have errors
} else {
if($_SESSION['hash_func'](strtolower($_POST['word']))==$_SESSION['freecap_word_hash'])
{
// reset freeCap session vars
// cannot stress enough how important it is to do this
// defeats re-use of known image with spoofed session id
$_SESSION['freecap_attempts'] = 0;
$_SESSION['freecap_word_hash'] = false;
$message = stripslashes($message);
$msg = "Sender's Name: $realname\n";
$msg .= "Sender's E-mail: $email\n";
$msg .= "Message: $message\n";
$mailheaders = "From: $email\n";
$mailheaders .= "Reply-To: $email\n\n";
mail("****@******.com", "*********", $msg, $mailheaders);
$sent = 1;
unset($realname);
unset($email);
unset($message);
$word_ok = "yes";
} else {
$word_ok = "no";
}
};
}