X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl-cms.git;a=blobdiff_plain;f=contact.php;h=11d53b29180c4751d2b1c9442ded404cbf4e7952;hp=743a953b0f31debe18cb64e09e59920e49287805;hb=948d843003f8f9f70e830e73ecd3e53bf231f247;hpb=1a0f752b1d93c50cc8caa3703452fdca6f97b936 diff --git a/contact.php b/contact.php index 743a953..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', $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'; }