i need to log the IP address of the person thats filling out the form.
i would love to have it show on the page and be sent by the report.
<?php
function efOnBeforeMailSent(&$fields) {
global $modx;
$fields['site_url'] = $modx->config['site_url'];
$fields['site_name'] = $modx->config['site_name'];
if (isset($_SERVER['REMOTE_HOST'])) {
$fields['ip_calc'] = $_SERVER['REMOTE_HOST']." (".$_SERVER['REMOTE_ADDR'].")";
} else {
$fields['ip_calc'] = gethostbyaddr($_SERVER['REMOTE_ADDR'])." (".$_SERVER['REMOTE_ADDR'].")";
}
$fields['cli_calc'] = $_SERVER['HTTP_USER_AGENT'];
$fields['question_calc'] = wordwrap($fields['question'], 75);
return true;
}... Message from: [+ip_calc+] ([+cli_calc+]) ...
so you are using that inside a chunk or.....? thanks.