Can I display different pages according to the users of different provinces?

Source: Internet
Author: User
目前想是在用户的数据库增加一个字段,每个页面都判断是哪个区域的,根据这个值显示限定的内容。但是员工分布很清晰了,一般都是以省划分的,IP应该会有一个范围把,这个可以作为一个识别规则吗。主要是想要一个网站能够根据不同的位置的人显示不同的内容,也只能关注到自己区域的动态和部分共同的动态。请问大家这种情况都是通过数据库字段去判断吗

Reply content:

目前想是在用户的数据库增加一个字段,每个页面都判断是哪个区域的,根据这个值显示限定的内容。但是员工分布很清晰了,一般都是以省划分的,IP应该会有一个范围把,这个可以作为一个识别规则吗。主要是想要一个网站能够根据不同的位置的人显示不同的内容,也只能关注到自己区域的动态和部分共同的动态。请问大家这种情况都是通过数据库字段去判断吗

can use Sohu Platform API approximate code is as follows ~

var returnCitySN = {"cip": "xxx.xxx.xxx.xxx", "cid": "310000", "cname": "XX市"};if(returnCitySN.cname == "上海市")   window.location = "blank.html"

The use of our project is qqwry very simple.

Use an open source IP library to differentiate between users who do not understand the region:)

Can, get access to the user's IP address attribution, make if...else judgment, and then jump to different pages on it

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.