当变量存在时 PHP 输出改变

发布于 2025-01-08 14:31:46 字数 517 浏览 1 评论 0原文

我的网站上发生了最奇怪的事情。我的 PHP 脚本根据是否存在查询标记 (?) 输出不同的内容。标记后面是否存在查询字符串并不重要——简单地存在“?”改变输出。我没有编写任何代码来查找该查询标记,更不用说根据是否找到它而做任何不同的事情了。这让我发疯!是否可以解释为什么会发生这种情况?

以下是示例链接:1) ...html,2) ...html?(最显着的变化发生在三月份。)

编辑:抱歉,我认为代码不会很有帮助,而且有很多代码。我认为您无法“重新创建问题”,因为此代码依赖于 Magento 来运行,但它就是这样。 (我必须删除很多注释才能使其符合大小要求。)

编辑:代码已删除,因为它对于寻找答案没有用或相关。

I have the weirdest thing happening on my site. My PHP script is outputting different content depending upon whether there's a query mark (?) present or not. It doesn't matter if there is a query string present after the mark or not - the simple presence of the "?" changes the output. I didn't code anything to even look for that query mark let alone do anything differently depending upon if it found it or not. It's driving me nuts! Could there be an explanation for why this is happening?

Here are sample links: 1) ...html, 2) ...html? (The most significant changes occur in the month of March.)

EDIT: Sorry, I didn't think the code would be very helpful, and there's a ton of it. I don't think you'll be able to "recreate the issue" since this code depends on Magento to run, but here it is. (I had to strip out a lot of comments to get it under the size requirements.)

EDIT: Code removed since it wasn't useful or pertinent to finding the answer.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

怪我闹别瞎闹 2025-01-15 14:31:46

听起来像是缓存问题。尝试清除一下...

http://kb.siteground.com/article/How_to_clear_the_cache_in_Magento.html< /p>

Magento 将其缓存保存在 Magento 安装目录内的 /var/cache 中。因此,例如,如果您的 Magento 安装在主 public_html 文件夹中,则缓存将位于 public_html/var/cache 中。

Sounds like a caching problem. Try clearing it out...

http://kb.siteground.com/article/How_to_clear_the_cache_in_Magento.html

Magento keeps its cache in /var/cache located inside the Magento installation directory. So, for example, if your Magento is installed in your main public_html folder, the cache will be in public_html/var/cache.

埖埖迣鎅 2025-01-15 14:31:46

抱歉,事实并非如此。位置保持不变。但它必须是可以通过被覆盖的 URL 传递的选项之一。检查什么选项可以为您提供与非参数查询相同的输出。

Sorry, that was not what was happening. The location remains unchanged. But it has to be one of the options that can be passed in by URL that is getting overritten. Check to see what option might make give you the same output as the non-parameter query.

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