Add IP address in input text field
Posted: 29 Jan 2017, 15:36
Dear admin i `m thankfully for your support `just great`.
With both examples for <input type="text"> it shows only string(13) but not the whole ip-adress.
if i place the code without the <input type="text" then it is working normal.
What could i do more to show into the <input type="text" the whole ip-adress ???
With both examples for <input type="text"> it shows only string(13) but not the whole ip-adress.
Code: Select all
<input type="text" name="from" class="form-control" value="<?php var_dump($_SERVER['REMOTE_ADDR']); ?>"/></div>
Code: Select all
<input type="text" name="from" class="form-control" value="<?php function getIP(){
return getenv('HTTP_CLIENT_IP')?: getenv('HTTP_X_FORWARDED_FOR')?:
getenv('HTTP_X_FORWARDED')?: getenv('HTTP_FORWARDED_FOR')?:
getenv('HTTP_FORWARDED')?: getenv('REMOTE_ADDR')?:'UNKNOWN IP';
}
$ip = getIP();
var_dump($ip);
?>"/>
What could i do more to show into the <input type="text" the whole ip-adress ???