PDA

View Full Version : Help! PHP Contact form with image verification.


xxmarsha
09-14-2009, 03:42 PM
I checked out a different post about the same sort of question but I wasn't able to get mine working. I have added some additional fields, however, it draws a blank when sent. How can I fix it?

<?php
// -----------------------------------------
// The Web Help .com
// -----------------------------------------
// remember to replace designedbymarsha@gmail.com with your own email address lower in this code.

// load the variables form address bar
$name = $_REQUEST["name"];
$lastname = $_REQUEST["lastname"];
$city = $_REQUEST["city"];
$state = $_REQUEST["state"];
$phone = $_REQUEST["phone"];
$message = $_REQUEST["message"];
$from = $_REQUEST["from"];
$verif_box = $_REQUEST["verif_box"];

// remove the backslashes that normally appears when entering " or '
$message = stripslashes($message);
$name = stripslashes($name);
$lastname = stripslashes($lastname);
$city = stripslashes($city);
$state = stripslashes($state);
$phone = stripslashes($phone);
$from = stripslashes($from);

// check to see if verificaton code was correct
if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
// if verification code was correct send the message and show this page
mail("designedbymarsha@gmail.com", 'Online Form: '.$lastname, .$city, .$state, .$phone, .$name, $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $from");
// delete the cookie so it cannot sent again by refreshing this page
setcookie('tntcon','');
} else {
// if verification code was incorrect then return to contact page and show error
header("Location:".$_SERVER['HTTP_REFERER']."?name=$name&lastname=$lastname&city=$city&state=$state&phone=$phone&from=$from&message=$message&wrong_code=true");
exit;
}
?>