Giter Club home page Giter Club logo

my-ip-info's Introduction

my-ip-info

Create an ip info Page with a style.css and an index.php file.

支持

  • 判断浏览器语言,非中文显示为英文。
  • curl指令返回ip地址 国家 城市
  • 在地图上显示位置

前提条件

  • 一个已经注册了域名并在Cloudflare进行了DNS解析的网站。
  • 注册了百度地图的开发者账号!点击注册

教程

  • 打包下载文件,将文件放在网站的根目录。
  • 注册百度地图开发者账号将自己的AK替换index中的149行 ENTERYOURS
  • 去Cloudflare进行域名解析并开启Proxy(小云朵)。
  • 在DNS下方规则选项卡中修改请求头的转换规则,创建新的规则并勾选自定义筛选表达式。设置字段为主机名,运算符为等于,值为网站地址。

设置动态IP信息:

  • 设置动态IP值:ip,值为ip.src
  • 设置动态IP-ASN:ip-asn,值为ip.geoip.asnum
  • 设置动态IP-City:ip-city,值为ip.src.city
  • 设置动态IP-Country:ip-country,值为ip.geoip.country
  • 设置动态IP-HTTP:ip-http,值为http.request.version
  • 设置动态IP-Lat:ip-lat,值为ip.src.lat
  • 设置动态IP-Lon:ip-lon,值为ip.src.lon
  • 设置动态IP-Threat:ip-threat,值为cf.threat_score
  • 设置动态IP-Time:ip-time,值为ip.src.timezone.name
  • 设置动态IP-UA:ip-ua,值为http.user_agent
  • 设置动态IP-Zip:ip-zip,值为ip.src.postal_code

保存设置。

完成!通过按照以上步骤进行操作,您将创建一个能够显示访问者IP信息的网页。

参考

Hostloc 嘉树 Hostloc 超级无敌小马甲 ChatGPT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.