SuperBeast
SuperBeast

Reputation: 243

PHP/CF is returning some weird string when trying to get the IP

Here is my code:

function get_ip() { 
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])){ 
return $_SERVER["HTTP_CF_CONNECTING_IP"]; 
} 
else{ 
return $_SERVER['REMOTE_ADDR']; 
} 
}

And it used to work fine up until this morning it is returning:

2602:306:cdaf:2da0:e132:a096:5eb:a342

Could anyone explain why?

Upvotes: 1

Views: 303

Answers (1)

Cjmarkham
Cjmarkham

Reputation: 9681

That is an IPV6 address rather than the usual IPV4 address.

Upvotes: 2

Related Questions