The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I have a good working PHP script at the moment for processing the user form data, and sendind it to my email address.
However, I would like to have an I.P. address to be also sent with the user form details.
Anyone know the php coding for this?
P.S. I already have a working mail it php script, just need to add I.P. function.
Freeola's own formmail php script can be setup to show the submitters IP address and 'user agent*' details.
Just add the following to your 'form' code:
<input type="hidden" name="env_report" value="yes">* User agent details give the visitors browser, OS, etc.
Search Freeola Chat
$_SERVER. $_SERVER['REMOTE_ADDR'] will get you the IP in most cases. However this won't normally work for proxied or shared connections. You can try this instead
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip=$_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip=$_SERVER['REMOTE_ADDR'];
}
I have a good working PHP script at the moment for processing the user form data, and sendind it to my email address.
However, I would like to have an I.P. address to be also sent with the user form details.
Anyone know the php coding for this?
P.S. I already have a working mail it php script, just need to add I.P. function.