hi all
i have a script and it shows the user ip i used this code on it
@gettheip = split(/\./,$ENV{'REMOTE_ADDR'});
but as i know this will get the proxy ip not the real ip for the user. then i changed to this one
@gettheip = split(/\./,$ENV{'HTTP_X_FORWARDED_FOR'});
and sometimes will get the ip and some time no ip show ... so is there any way to make this code work if it can't get the REMOTE_ADDR it will get the HTTP_X_FORWARDED_FOR and vice versa .....
i have a script and it shows the user ip i used this code on it
@gettheip = split(/\./,$ENV{'REMOTE_ADDR'});
but as i know this will get the proxy ip not the real ip for the user. then i changed to this one
@gettheip = split(/\./,$ENV{'HTTP_X_FORWARDED_FOR'});
and sometimes will get the ip and some time no ip show ... so is there any way to make this code work if it can't get the REMOTE_ADDR it will get the HTTP_X_FORWARDED_FOR and vice versa .....