Home Backend Development PHP Tutorial 360 search engine automatically includes PHP rewriting solution PHP examples

360 search engine automatically includes PHP rewriting solution PHP examples

Jun 26, 2018 pm 05:03 PM
search engine

This article mainly introduces the relevant information of 360 search engine’s automatic inclusion of PHP rewriting plan. Friends who need it can refer to

360 search engine’s automatic inclusion function. The official code is provided in a tape format, which is very cheating. , does not provide a batch submission entrance, but only provides a piece of js code. The key is that one js downloads another js, document.write to the document, and then repeats the same process twice.

Weak question: Why not provide a batch submission entrance like Baidu?

Could it be that this automatic submission function is used to collect website data, such as document.refer and other data? Isn't this one more rogue?

It is said that 360’s search engine currently has a market share of more than 20% in China. I don’t know whether it is true or not, but I am very skeptical!

At least I basically only use Google! However, in China, Baidu is still basically used, and there are still too many newbies!

I have no choice but to endure it and add 360’s automatic inclusion!

So we made some changes to the code!

The original code of the official website is as follows:

<script>(function(){
var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?970506d365e969bd0e92a2611c18678e":"https://jspassport.ssl.qhimg.com/11.0.1.js?970506d365e969bd0e92a2611c18678e";
document.write(&#39;<script src="&#39; + src + &#39;" id="sozz"><\/script>&#39;);
})();
http://js.passport.qihucdn.com/11.0.1.js?970506d365e969bd0e92a2611c18678e
document.write(&#39;<script charset="utf-8" src="http://s7.qhres.com/static/ab77b6ea7f3fbf79.js"></script>&#39;)
Copy after login

The code provided by the official website has entered the quadratic document.write code as follows, this js The code is as follows:

/**
 * 360推送 @www.zhoulujun.cn
 
 */
function getPushSoUrl($url){
  $token="970506d365e969bd0e92a2611c18678e";
  return $str="http://s.360.cn/so/zz.gif?url=".urlencode($url)."&sid=". $token."&token=".getPushToken($url,$token);
}
function getPushToken($url,$o){
  $n = str_split($url,1);
  $n=array_reverse($n);
  $r = str_split($o,1);
  $i=[];
  for($s=0,$o=16;$s<$o;$s++)
  {
 
    array_push($i,empty($n[$s])?$r[$s]:$r[$s].$n[$s]);
  }
  return implode($i);
}
/*
class push_so_url{
  private $token="970506d365e969bd0e92a2611c18678e";
  public function setToken($token){
    $this->token=$token;
  }
//  function __construct($token) {
//    $this->token=$token;
//  }
  public function getPushToken($url,$o){
    $n = str_split($url,1);
    $n=array_reverse($n);
    $r = str_split($o,1);
    $i=[];
    for($s=0,$o=16;$s<$o;$s++)
    {
 
      array_push($i,empty($n[$s])?$r[$s]:$r[$s].$n[$s]);
    }
    return implode($i);
  }
  public function getImgUrl($url){
    return $str="http://s.360.cn/so/zz.gif?url=".urlencode($url)."&sid=". $this->token."&token=".$this->getPushToken($url,$this->token);
  }
 
 
}
*/
Copy after login

In the template phpcms/templates/default/content/, for example, show index, add the following code:

<img src="{getPushSoUrl($_SERVER[&#39;HTTP_HOST&#39;].$url)}">
Copy after login

Related recommendations:

Detailed explanation of php and ethereum client interaction php examples

PHP cURL Get WeChat public account Example of access_token php example

PHP implements the turntable lottery algorithm sharing php example


The above is the detailed content of 360 search engine automatically includes PHP rewriting solution PHP examples. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to change search engines on iPhone and iPad How to change search engines on iPhone and iPad Apr 25, 2023 am 08:28 AM

It's easy to change the search engine in Safari, Google Chrome, or other browsers on your iPhone or iPad. This tutorial will show you how to do it on four different web browsers available on iPhone and iPad. How to Change the Safari Search Engine on iPhone or iPad Safari is the default web browser on iOS and iPadOS, but you might not like the search engine. Fortunately, you can use these steps to change it: On your iPhone or iPad, launch Settings from the Home screen. Swipe down and tap Safari from the list. In the next menu,

Baidu cloud disk search engine entrance Baidu cloud disk search engine entrance Feb 27, 2024 pm 01:00 PM

Baidu Cloud is a software that allows users to store many files. So what is the entrance to Baidu Cloud Disk search engine? Users can enter the URL https://pan.baidu.com to enter Baidu Cloud Disk. This sharing of the latest entrance to Baidu Cloud Disk search engine will give you a detailed introduction. The following is a detailed introduction. Take a look. . Baidu cloud disk search engine entrance 1. Qianfan search website: https://pan.qianfan.app Supports network disk: aggregate search, Alibaba, Baidu, Quark, Lanzuo, Tianyi, Xunlei network disk viewing method: login required, follow the company Advantages of obtaining the activation code: The network disk is comprehensive, there are many resources, and the interface is simple. 2. Maolipansou website: alipansou.c

Java development: How to implement search engine and full-text retrieval functions Java development: How to implement search engine and full-text retrieval functions Sep 21, 2023 pm 01:10 PM

Java development: How to implement search engine and full-text retrieval functions, specific code examples are required Search engines and full-text retrieval are important functions in the modern Internet era. Not only do they help users find what they want quickly, they also provide a better user experience for websites and apps. This article will introduce how to use Java to develop search engines and full-text retrieval functions, and provide some specific code examples. Full-text search using Lucene library Lucene is an open source full-text search engine library, developed by ApacheSo

PHP search engine performance optimization: Algolia's magic trick PHP search engine performance optimization: Algolia's magic trick Jul 23, 2023 pm 04:21 PM

PHP Search Engine Performance Optimization: Algolia’s Magical Way With the development of the Internet and the increasing user requirements for search experience, search engine performance optimization has become crucial. In the world of PHP development, Algolia is a powerful and easy-to-integrate search engine service. This article will introduce the magical uses of Algolia and how to optimize the performance of PHP search engines through Algolia. Algolia introduction Algolia is a search engine service provider based on SaaS model.

In the field of artificial intelligence search, Google and Microsoft compete In the field of artificial intelligence search, Google and Microsoft compete Apr 08, 2023 am 11:31 AM

Since its launch late last year, ChatGPT has been seen as a major threat to traditional ways of searching for information. Because it is diverse, you can answer people's questions, write essays or poems, or even write program code. The ability of conversational AI to provide coherent answers is considered a threat to Google's search engine, which for decades has been the benchmark platform for people to search for information on the Internet. OpenAI’s ChatGPT can tailor answers to specific questions asked by users, which can save time browsing websites. A report published by The New York Times in December revealed that ChatGPT’s overnight success forced Google to call it “Code Red” and begin addressing the threat posed by artificial intelligence chatbots to its search engine business. according to

How to set up Google Chrome to change the search engine? How to change the search engine in the browser How to set up Google Chrome to change the search engine? How to change the search engine in the browser Mar 15, 2024 pm 12:49 PM

How to change the search engine in Google Chrome? Google Chrome is a very popular browser among users. It not only has simple and easy-to-use services, practical tools and other auxiliary functions, but also can meet the different needs of different users. Search engines generally default to Google. If we want to How should I set it up to replace it? Let me share the method below. Replacement method 1. Click to open Google Chrome. 2. Click the three-dot icon to open the menu interface. 3. Click the Settings option to enter the browser’s settings interface. 4. Find the search engine module in the settings interface. 5. Click the Manage Search Engine button. 6. You can see an add button. Click this add button to add a search engine.​

How to implement a full-text search engine in PHP7.0? How to implement a full-text search engine in PHP7.0? May 26, 2023 pm 04:51 PM

With the continuous development of the information age, people increasingly rely on the Internet to obtain information. As one of the platforms for information sharing, web search engines are also constantly evolving and improving. This article will introduce how to implement a full-text search engine in PHP7.0, helping readers make better use of PHP technology and quickly build an efficient search engine. 1. Overview of full-text search engines Full-text search uses keywords or phrases to search throughout the document to find the most matching results. Full-text search engines use algorithms to index documents to speed up searches. exist

PHP and Manticore Search Development: Building an Efficient Search Engine PHP and Manticore Search Development: Building an Efficient Search Engine Aug 07, 2023 am 09:45 AM

PHP and ManticoreSearch development: Building an efficient search engine Search engines play a very important role in modern Internet applications. In order to achieve efficient and accurate search functions, we need to choose a suitable search engine and use appropriate development tools for development. This article will introduce how to use PHP and ManticoreSearch to develop an efficient search engine. ManticoreSearch is a powerful open source search engine based on SphinxS

See all articles