MediaWiki 无法获取路径

发布于 2024-12-08 13:31:10 字数 609 浏览 1 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

所谓喜欢 2024-12-15 13:31:10

如果您需要 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文