Ever wanted to add the senders IP address when submitting a message via the contact form? Just use our one line code hack.
This is a simple way to add the contact form senders IP address to the message for easy tracking; this is especially useful when you get those contact form spam emails.
addendum:Joomla! copies over this file with each update, but the fix is the same; just apply the code below to /components/com_contact/controller.php and you are ready to go.
It is a source code hack, and it works in Joomla 1.5.8 through 1.5.15; and you might need to change it or re-apply it when Joomla! releases the next version. The line number has been updated for the latest Joomla release 1.5.15.
Always, backup the source file before changing.
in file: /components/com_contact/controller.php
change line 169 from:
$body = $prefix."\n".$name.' <'.$email.'>'."\r\n\r\n".stripslashes($body);
to:
$body = $prefix."\n".$name.' ('.getenv('REMOTE_ADDR').' - '.gethostbyaddr(getenv('REMOTE_ADDR')).')' ."\r\n\r\n".stripslashes($body);
This will give you an email looking like this:
This is an enquiry e-mail via http://www.YOURWEBSITE.com/ from:
contact name (xxx.xx.xx.xxx - h169n2-gl-a-d5.ias.bredband.telia.com)
This is the message body.
- Joomla 1.5.15 Highlights...
Klas Berlič points out some of the most important changes that comes with the Joomla 1.5.15 release. ... - Joomla 1.5.15 Security Release...
Joomla releases Joomla 1.5.15 - A security Release compromising of two security issues found in Joomla 1.5.14. ... - Joomla 1.5.14 Released...
Joomla! released 1.5.14 on July 30, 2009, only eight days after releasing 1.5.13. ...





