RyanB88
09-08-2007, 03:46 PM
All right, so I found this script online at http://www.thewebhelp.com/php/php_contact_form_with_image_validation/
but I needed to update it for my needs. I am keeping the image validation, but wanted to expand on the form. So I got these form fields:
name
home_phone
cell_phone
work_phone
email
contact_method
contact_time
issue
verif_box
I got this code so far:
<?php
// load the variables form the post
$from = $_POST["email"];
$verif_box = $_POST["verif_box"];
$name = $_POST["name"];
$home_phone = $_POST["home_phone"];
$cell_phone = $_POST["cell_phone"];
$work_phone = $_POST["work_phone"];
$contact_method = $_POST["contact_method"];
$contact_time = $_POST["contact_time"];
$issue = $_POST["issue"];
// build the message
$message = //this is where i need help
// remove the backslashes that normally appears when entering " or '
$message = stripslashes($message);
$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 sucsess page
mail("ryan.bilesky@hotmail.com", 'Online Form', $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $from");
// delete the cookie so it cannot sent again by refreshing this page
setcookie('tntcon','');
header("Location: http://www.rcbitsolutions.com/contact/?sent");
} else {
// if verification code was incorrect then show error page
header("Location: http://www.rcbitsolutions.com/contact/?badverify");
exit;
}
?>
What i need is help building the message to be sent, to combine name, home_phone, cell_phone, work_phone, contact_method, contact_time, and issue into a readable message.
Thanks in advance for your help.
but I needed to update it for my needs. I am keeping the image validation, but wanted to expand on the form. So I got these form fields:
name
home_phone
cell_phone
work_phone
contact_method
contact_time
issue
verif_box
I got this code so far:
<?php
// load the variables form the post
$from = $_POST["email"];
$verif_box = $_POST["verif_box"];
$name = $_POST["name"];
$home_phone = $_POST["home_phone"];
$cell_phone = $_POST["cell_phone"];
$work_phone = $_POST["work_phone"];
$contact_method = $_POST["contact_method"];
$contact_time = $_POST["contact_time"];
$issue = $_POST["issue"];
// build the message
$message = //this is where i need help
// remove the backslashes that normally appears when entering " or '
$message = stripslashes($message);
$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 sucsess page
mail("ryan.bilesky@hotmail.com", 'Online Form', $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $from");
// delete the cookie so it cannot sent again by refreshing this page
setcookie('tntcon','');
header("Location: http://www.rcbitsolutions.com/contact/?sent");
} else {
// if verification code was incorrect then show error page
header("Location: http://www.rcbitsolutions.com/contact/?badverify");
exit;
}
?>
What i need is help building the message to be sent, to combine name, home_phone, cell_phone, work_phone, contact_method, contact_time, and issue into a readable message.
Thanks in advance for your help.