R
R
Roman Govorov2019-08-08 11:39:24
PHP
Roman Govorov, 2019-08-08 11:39:24

How not to run PHP code if a bot visited the site?

There is a line: $ip_data = @json_decode(file_get_contents(" www.geoplugin.net/json.gp?lang=ru&ip= " . $ip));
It is necessary to make sure that the request is not executed if it is Google or Yandex or Yahoo , etc. bot
How to implement it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Sviridov, 2019-08-08
@dimuska139

Try this lib https://packagist.org/packages/jaybizzle/crawler-detect

J
jeruthadam, 2019-08-08
@jeruthadam

Well done. What you want is called CLOAKING - and this is one of the most terrible crimes against search engines, fraught with an inevitable ban. Pretty boy))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question