当前位置:网站首页>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 .
边栏推荐
- NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
- Register in PHP_ Globals parameter settings
- 远程办公之大家一同实现合作编辑资料和开发文档 | 社区征文
- The mixlab editing team is recruiting teammates~~
- Myopia: take off or match glasses? These problems must be understood clearly first
- 拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
- Simulink oscilloscope data is imported into Matlab and drawn
- Learn from me about the enterprise flutter project: simplified framework demo reference
- QT串口ui设计和解决显示中文乱码
- Develop team OKR in the way of "crowdfunding"
猜你喜欢

What material is sa537cl1? Sa537cl1 corresponds to the national standard material

NSQ源码安装运行过程

Aike AI frontier promotion (7.3)

【LeetCode】94. Middle order traversal of binary tree

arduino-esp32:LVGL项目(一)整体框架

IDEA-配置插件

Mysql 将逗号隔开的属性字段数据由列转行

word 退格键删除不了选中文本,只能按delete

NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线

The mixlab editing team is recruiting teammates~~
随机推荐
[combinatorics] summary of combinatorial identities (eleven combinatorial identities | proof methods of combinatorial identities | summation methods)*
于文文、胡夏等明星带你玩转派对 皮皮APP点燃你的夏日
远程办公之大家一同实现合作编辑资料和开发文档 | 社区征文
Caching mechanism of Hibernate / session level caching mechanism
Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
8 tips for effective performance evaluation
"Everyday Mathematics" serial 56: February 25
Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (4)
TCP擁塞控制詳解 | 3. 設計空間
PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
Basis of target detection (IOU)
PHP CI(CodeIgniter)log级别设置
Leetcode binary search tree
EditText request focus - EditText request focus
斑马识别成狗,AI犯错的原因被斯坦福找到了
【剑指 Offer 】64. 求1+2+…+n
Difference between JSON and bson
8 cool visual charts to quickly write the visual analysis report that the boss likes to see
探索Cassandra的去中心化分布式架构
[solved] access denied for user 'root' @ 'localhost' (using password: yes)