The User class

The User class is designed to extract and manage user-related network information from a browser cookie. It provides methods to access this data and control user flow, such as blocking suspicious users or redirecting them to another page.

You can use this class anywhere inside any PHP code in our cPanel Hosting.

How to use it?

let user = new User;

Public Methods:

user.Block();

Sends a 403 Forbidden HTTP status and stops the script.

user.Redirect(url);

Redirects the client to the provided URL using the Location header.

user.getInfo();

Returns all user data (IP, domain, country, timezone, ASN, ASN name, ISP, proxy status, DNS).

user.getIp();

Returns the user's IP address.

user.getDomain();

Returns the domain the user accessed.

user.getCountry();

Returns the user's country code.

user.getTimezone();

Returns the user's timezone.

user.getAsn();

Returns the Autonomous System Number (ASN).

user.getAsnname();

Returns the name of the ASN (usually the ISP or organization).

user.getIsp();

Returns the name of the user's Internet Service Provider.

user.getProxy();

Returns proxy/VPN status (e.g., yes or no).

user.getDns();

Returns the user's DNS server IP.

Was this answer helpful? 4 Users Found This Useful (7 Votes)