当变量存在时 PHP 输出改变
我的网站上发生了最奇怪的事情。我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来像是缓存问题。尝试清除一下...
Sounds like a caching problem. Try clearing it out...
抱歉,事实并非如此。位置保持不变。但它必须是可以通过被覆盖的 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.