REQUEST_URI错误:出现在functions.php神秘的73行

原梓番
原梓番
管理员
827
文章
0
粉丝
建站 技术流评论3,960阅读模式
Warning: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ (this will throw an Error in a future version of PHP) in /var/www/web/wp-content/themes/slatudou/functions.php on line 73

这个奇怪的错误,到底是为什么呢

打开funcitons.php第73行,代码如下:文章源自原紫番博客-https://www.yuanzifan.com/54311.html

$path = $_SERVER['HTTP_HOST'] . $_SERVER[REQUEST_URI];

注意到什么问题了么,一边少了一个单引号:REQUEST_URI的左右。文章源自原紫番博客-https://www.yuanzifan.com/54311.html

加上双引号,问题解决:文章源自原紫番博客-https://www.yuanzifan.com/54311.html

<pre>$path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];</pre>

文章源自原紫番博客-https://www.yuanzifan.com/54311.html 文章源自原紫番博客-https://www.yuanzifan.com/54311.html

站长微信
扫码添加(注明来意)
weinxin
Yuanzifan99
微信号已复制
原梓番博客公众号
博客内容精选
weinxin
原梓番博客
公众号已复制
 

发表评论

匿名网友
确定

拖动滑块以完成验证