is_valid) {
// Simple Form Script
// Copyright (C) 2005 Eric Zhang
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// Please send bugs/questions to erkzh@yahoo.com.
//--------------------------Set these paramaters--------------------------
//$isin = substr_count($_REQUEST['Email'], "@");
$carbon = "";//$_REQUEST['carbon'];
$subject = $_REQUEST['subject']; // Subject of email sent to you.
$emailadd = $_REQUEST['mailbox']; // Your email address. This is where the form information will be sent.
$url = $_REQUEST['forward']; // Where to redirect after form is processed.
$req = '0'; // Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 40)
{echo "Name of form element $key cannot be longer than 40 characters";die;}
$j = 40 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
$headers = "";//'To: '.$emailadd. "\r\n";
$headers .= 'From: '.$_POST['form_email'].' <'.$_POST['form_email'].'>' . "\r\n";
$headers .= 'Cc: '.$carbon. "\r\n";
mail($emailadd, $subject, $text, $headers) or die( "Cannot send mail" );
header("Location: $url");
} else {
# set the error code so that we can display it. You could also use
# die ("reCAPTCHA failed"), but using the error message is
# more user friendly
$error = $resp->error;
}
} ?>