00:00
00:00
Newgrounds Background Image Theme

Thrll just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

PHP getting IP

1,195 Views | 1 Reply
New Topic Respond to this Topic

PHP getting IP 2015-05-10 17:22:44


So, currently, I am using this to get the IP address of visitors. (REMOTE_ADDR does not work due to use of CloudFlare)

$_SERVER['HTTP_X_FORWARDED_FOR'];

Is this safe? Like is it possible for someone to somehow spoof this since its an HTTP header? I would think that CloudFlare would be the one sending it though as visitors connect through that.


derp

Response to PHP getting IP 2015-05-11 01:24:30


Install mod_cloudflare on your apache server and use $_SERVER["HTTP_CF_CONNECTING_IP"].


If you're a Newgrounds OG who appreciates Flash games with depth, check out the game I made in 2024.