If you want the forms you receive to contain the IP address belonging to the user who sends the form, follow these simple steps:
1. Add this PHP code to your webpage's header:
<?
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'];
}
?>
2. Under your form's opening tag (<form>), add this code:
<input type="hidden" name="ip" value="<?=$ip;?>">
In the forms you'll receive, you'll see the IP address belonging to each user under the field "ip". Users won't see nothing when filling or sending the form, since this is a hidden field.
Hi Daniel, How can I contact you? Would love to chat about some potential work we have.