Community
All Features
Overview of all exisiting features.
Arcade
Play various games in the arcade.
Awards
Earn awards for different tasks.
Bug Tracker
Report site related bugs the right way.
Credits
Everything related to credits.
Groups
A list of user run groups you can join.
Help Center
Official regulations and help documents.
Member List
A list of all registered members.
Latest Announcements
Staff Recruitment | September 2022
Changelog #34 - 03/04/2022
April Update - Index Redesign and Unlock Content Experiment
Support
Shop
Upgrade
Log In
Create Account
NulledBB
General
Technology & Development
Backend Development
Getting and validating IPs in PHP. (NOOBS Only!)
Create an account
Login
PrivateAlps.net - Offshore Cloud Services | VPS/RDP/VPN - Dedicated Servers - Webhosting - TOR Services - Auto Deploy
ADULTSLAYER.STORE 💎 #1 PORN SHOP | 700+ Hot Products: Brazzers, Teamskeet, Pornhub, NaughtyAmerica, Many More! | 💸 Secure PayPal & Card Payments | Satisfaction Guaranteed! 🔥
Backend Development
Getting and validating IPs in PHP. (NOOBS Only!)
Submitted by LightningXd,
10-03-2016, 12:26 AM
, Thread ID: 19268
Thread Closed
Reply
10-03-2016, 12:26 AM
#1
Hi guys,
So, if you are looking to make a basic IP grabbing tool in PHP or something that requires you to get the user's IP address then all you have to do is:
PHP Code:
$_SERVER
[
'REMOTE_ADDR'
]
This is actually the most secure way of getting the IP of the visitor/user, and a way to validate this IP address is:
PHP Code:
filter_var
(
$_SERVER
[
'REMOTE_ADDR'
],
FILTER_VALIDATE_IP
).
More
Users browsing this thread: 2 Guest(s)