当前位置:网站首页>PHP production website active push (website)
PHP production website active push (website)
2022-07-03 16:39:00 【Confused autumn wind】
PHP Make the whole site active push ( Website )
Home directory
To write PHP Push file
url.php
<?php
$url1=$_SERVER['HTTP_HOST'];// Read the current web page URL
$url2=$_SERVER['REQUEST_URI'];// Read URL The back page of
$urlxieyi='http://';// Protocol header , It's fine too HTTPS
$urlhome=$urlxieyi.$url1.$url2;// Combine these information
$urls = array(
$urlhome // To push URL
);
$api = ' Your interface call address ';
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $urls),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
//echo $result; // Displays whether the submission was successful , Debugging can be opened if necessary
//echo $urlhome; // Show current web page URL, Debugging can be opened if necessary
?>
Introduction of global files
To submit successfully, this file must be introduced into every page
footer.php
<?php require("./url.php"); ?>
You can also add the above reference code to any PHP In the document , As long as you want to push this page, add it .
Principle of submission
We submit the page by referencing the file , When the user accesses and adds url.php When quoting pages , It triggers the operation , When it runs, it will submit this page to Baidu , Every visit will be submitted , It saves a lot of time .
边栏推荐
- "Everyday Mathematics" serial 56: February 25
- Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
- How to initialize views when loading through storyboards- How is view initialized when loaded via a storyboard?
- Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
- 关于视觉SLAM的最先进技术的调查-A survey of state-of-the-art on visual SLAM
- 远程办公之大家一同实现合作编辑资料和开发文档 | 社区征文
- Détails du contrôle de la congestion TCP | 3. Espace de conception
- 2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
- MongoDB 的安装和基本操作
- Explore Cassandra's decentralized distributed architecture
猜你喜欢
[statement] about searching sogk1997 and finding many web crawler results
TCP拥塞控制详解 | 3. 设计空间
One article takes you to understand machine learning
MySQL converts comma separated attribute field data from column to row
Record a jar package conflict resolution process
Simulink oscilloscope data is imported into Matlab and drawn
What is the pledge pool and how to pledge?
【声明】关于检索SogK1997而找到诸多网页爬虫结果这件事
探索Cassandra的去中心化分布式架构
First knowledge of database
随机推荐
Custom plug-in construction and use of QT plug-in
Leetcode binary search tree
One article takes you to understand machine learning
Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
Unreal_ Datatable implements ID self increment and sets rowname
JSON 与 BSON 区别
在ntpdate同步时间的时候出现“the NTP socket is in use, exiting”
Using optimistic lock and pessimistic lock in MySQL to realize distributed lock
NSQ源码安装运行过程
Overview of satellite navigation system
PHP secondary domain name session sharing scheme
How to set up SVN server on this machine
Top k questions of interview
0214-27100 a day with little fluctuation
【剑指 Offer】58 - I. 翻转单词顺序
QT serial port UI design and solution to display Chinese garbled code
跟我学企业级flutter项目:简化框架demo参考
14 topics for performance interviews between superiors and subordinates (4)
(补)双指针专题
How programming apes grow rapidly