This is a PHP class that allows you to retrieve details about an IP address using the IPinfo API. The class utilizes the Tailwind CSS framework for styling and also allows the user to copy the IP address to their clipboard.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- PHP
- IPinfo access token (sign up on ipinfo.io to get one)
- Google Maps API Key (sign up on Google Cloud Platform to get one)
- Clone the repository:
git clone https://github.com/ShiponKarmakar/ip-info.git
- Create a new file
config.php
in the root directory and add the following code:
<?php
$access_token = 'YOUR_IP_INFO_TOKEN';
$google_map_api_key = 'YOUR_API_KEY';
- Replace
YOUR_IP_INFO_TOKEN
with your own IPinfo access token andYOUR_API_KEY
with your own Google Maps API key. - Open
index.php
in a browser and you should see a form where you can enter an IP address to get its details.
index.php
- The main script fileconfig.php
- The configuration file where you need to add your API keysassets/
- The directory where the CSS and JavaScript files are locatedincludes/
- The directory where theip-info-class.php
file is located. This file contains theIPInfo
class which is used to get the details of an IP address.
Shipon Karmakar Initial work - GitHub
If you have any questions or issues, please open an issue in the GitHub repository or reach out to the IPinfo team for support.