MediaWiki 无法获取路径
我的 MediaWiki 无法获取我的实时网络服务器的路径。代码如下:
$script = $_SERVER['SCRIPT_NAME'];
$path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
$path = str_replace( '//', '/', $path );
$ext = pathinfo( $script, PATHINFO_EXTENSION );
echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\">enter</a>";
localhostwebserver 将回显显示为: Please enter
,
但是实时服务器将回显显示为 Please enter
这怎么可能?需要帮助!
My MediaWiki cannot get the path of my live web server. Here is the code:
$script = $_SERVER['SCRIPT_NAME'];
$path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
$path = str_replace( '//', '/', $path );
$ext = pathinfo( $script, PATHINFO_EXTENSION );
echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\">enter</a>";
The localhostwebserver displays the echo as: Please <a href=wiki.website.com/mw-config/index.php\">enter</a>
,
but the live server displays the echo as Please <a href=\/mw-config/index.php\">enter</a>
How is that possible? Need help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您需要 php 中当前页面的 url,我可以推荐 this 脚本。我已经成功使用它很多年了。
If you need the url of the current page in php, I can recommend this script. I have used it successfully for years.