K
K
Kaunov_ivan2015-08-26 10:23:46
JavaScript
Kaunov_ivan, 2015-08-26 10:23:46

How to delete part of the data from the site depending on the user's city or city?

The task is this:
There is a site created for one city. Everywhere there is the name of this city - "tmutarakan".
But when a person from Mirovsk comes in, the word "tmutarakan" should disappear. Is it possible to track from which dialect the user came to the site?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IceJOKER, 2015-08-26
@Kaunov_ivan

ipgeobase.ru/?address=REMOTE_ADDR - get the user's city, store it in the SESSION (so as not to download the same thing 100500 times), and further

if($user['city'] == 'тмутаракань')
{
  echo 'тмутаракань';
}

A
astrojunk, 2015-08-26
@astrojunk

if all the same the question is in the js / angular context, then add the module for obtaining the name of the city by geoIP.
something like this stackoverflow.com/questions/6797569/get-city-name-...
and then we use the resulting name in objects when rendering. Angular itself should generally update the template as soon as you change the value of the city

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question