X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=contact.php;h=e19fe19ec812c036c93059451ccddeafccc82d7d;hb=26e88a8fcd1bcbb101245a2243c6fb9cfeda3500;hp=86fccb90faee18b21afa76d5265b7313049d207d;hpb=4b384795e53cbbe789739bdc91e704803809c110;p=wfpl-cms.git diff --git a/contact.php b/contact.php index 86fccb9..e19fe19 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'; }