X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=contact.php;h=11d53b29180c4751d2b1c9442ded404cbf4e7952;hb=d8a3c68fe7131555725440aabc9f82e53520b5dc;hp=769b2c54189028fd874e068a9fe58cba48ad55da;hpb=608730c54e00a21b2d2615387e7980dd413eec39;p=wfpl-cms.git diff --git a/contact.php b/contact.php index 769b2c5..11d53b2 100644 --- a/contact.php +++ b/contact.php @@ -1,16 +1,19 @@ "; + if ($GLOBALS['contact_to'] != 'fixme@example.com') { + $to = $GLOBALS['contact_to']; + if ($GLOBALS['contact_from'] === '') { + $from = "$host/contact "; + } else { + $from = $GLOBALS['contact_from']; + } $reply_to = $to; - if(isset($data['email']) and valid_email($data['email'])) { + if (isset($data['email']) and valid_email($data['email'])) { $reply_to = $data['email']; - if($data['name'] and ereg('^[a-zA-Z0-9_\' -]*$', $data['name']) !== false) { + if ($data['name'] and ereg('^[a-zA-Z0-9_\' -]*$', $data['name']) !== false) { $reply_to = "$data[name] <$reply_to>"; } } - $subject = "Your message via $host/contact"; + if ($GLOBALS['contact_subject'] === '') { + $subject = "Your message via $host/contact"; + } else { + $subject = $GLOBALS['contact_subject']; + } $email_template = new tem(); $email_template->load('contact.email.txt'); $email_template->sets($data); - $email_template->set('$host', this_host()); + $email_template->set('$host', $host); $message = $email_template->run(); - $cc = ''; + $cc = $GLOBALS['contact_cc']; $bcc = ''; - if(email($from, $to, $subject, $message, $reply_to, $cc, $bcc)) { + if (email($from, $to, $subject, $message, $reply_to, $cc, $bcc)) { message('Due to an internal error, your message could not be sent. Please try again later.'); $error = true; } else { message('Message sent'); } } - if($error !== true) { + if ($error !== true) { # FIXME create this page or change this to go elsewhere return './contact_thanks'; }