当前位置:网站首页>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 .
边栏推荐
- 什么是质押池,如何进行质押呢?
- How to initialize views when loading through storyboards- How is view initialized when loaded via a storyboard?
- Nifi from introduction to practice (nanny level tutorial) - flow
- Interpretation of several important concepts of satellite antenna
- NLP four paradigms: paradigm 1: fully supervised learning in the era of non neural networks (Feature Engineering); Paradigm 2: fully supervised learning based on neural network (Architecture Engineeri
- 1287. Elements that appear more than 25% in an ordered array
- 在ntpdate同步时间的时候出现“the NTP socket is in use, exiting”
- Cocos Creator 2. X automatic packaging (build + compile)
- Acwing game 58
- 线程池执行定时任务
猜你喜欢

跟我学企业级flutter项目:简化框架demo参考

The mixlab editing team is recruiting teammates~~

Cocos Creator 2. X automatic packaging (build + compile)

探索Cassandra的去中心化分布式架构

2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises

Add color to the interface automation test framework and realize the enterprise wechat test report

Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (4)

【LeetCode】94. Middle order traversal of binary tree

一台服务器最大并发 tcp 连接数多少?65535?

QT serial port UI design and solution to display Chinese garbled code
随机推荐
One article takes you to understand machine learning
PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
Advanced Mathematics (Seventh Edition) Tongji University exercises 2-1 personal solutions
深入理解 SQL 中的 Grouping Sets 语句
斑馬識別成狗,AI犯錯的原因被斯坦福找到了
Nifi from introduction to practice (nanny level tutorial) - flow
[solved] access denied for user 'root' @ 'localhost' (using password: yes)
NLP four paradigms: paradigm 1: fully supervised learning in the era of non neural networks (Feature Engineering); Paradigm 2: fully supervised learning based on neural network (Architecture Engineeri
8个酷炫可视化图表,快速写出老板爱看的可视化分析报告
PHP converts a one-dimensional array into a two-dimensional array
MySQL single table field duplicate data takes the latest SQL statement
Cocos Creator 2.x 自动打包(构建 + 编译)
Mysql 单表字段重复数据取最新一条sql语句
Is it safe to open a stock account by mobile registration? Does it need money to open an account
TCP congestion control details | 3 design space
NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
[sword finger offer] 58 - I. flip the word order
Pytorch 1.12 was released, officially supporting Apple M1 chip GPU acceleration and repairing many bugs
What material is sa537cl1? Sa537cl1 corresponds to the national standard material
Caching mechanism of Hibernate / session level caching mechanism