Viewing file: process.php (1.43 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
//just keep adding recipients here (uncomment, copy/paste) $recipient = 'dan@danpsomas.com';
$logfile = 'logfile.csv';
ob_start(); include '../include/functions.php'; /* include_once '../include/captcha/securimage.php'; $securimage = new Securimage(); if ($securimage->check($_POST['captcha'])) { $validated = TRUE; } else { $data = $_POST; $data['captcha'] = ''; $error[] = 'The code you entered did not match'; } */
if ($error){ include 'index.php'; exit; }
$fields['Date'] = date("m/d/Y H:i:s"); $fields['Name'] = $_POST['name']; $fields['Reason for visit'] = $_POST['reason']; $fields['Comments'] = $_POST['comments']; $fields['Rating'] = $_POST['stars'];
define ('FROM_EMAIL', 'DoNotReply@makrasrealestate.com'); define ('FROM_NAME', 'Makras Real Estate Website');
$subject = 'Response From makrasrealestate.com Feedback Page';
$from = FROM_EMAIL;
$text_only = 'The following information has been collected from makrasrealestate.com. ----------------------------------------------------------------
';
while ($a = each($fields)){ $text_only .= $a[0].': '.$a[1].'
'; } $fh_logfile = fopen($logfile, 'a+'); fputcsv($fh_logfile, $fields); fclose($fh_logfile);
if (mail($recipient,$subject,$text_only,"From: $from\n") ){ } else{ $e .= $mail_obj -> ErrorInfo; }
$errlog = fopen('mailerror.txt', 'a'); fwrite($errlog, "\n\n".date("Y-m-d H:i:s")."\n".$e."\n------------------------------");
header('location: thankyou.php');
?>
|