PHP 中的动态图像与 GET 参数出现在
中;标签
我知道这个问题与这个问题非常相似: 指向一个标记到由 PHP 动态生成的图像?
但在我的方法中,我需要每次发送不同的 GET 参数(有时是一组特定的 GET 参数,有时是一组完全不同的参数)。此解决方案无法修复它: 指向一个标记到由 PHP 动态生成的图像?
有人知道如何解决这个问题吗?
I understand this question is pretty similar to this question: Point an <img> tag to a image dynamically generated by PHP?
But in mine I need to send it different GET parameters each time (sometimes it's a certain set of GET params and sometimes it's a completely different set). This solution was unable to fix it: Point an <img> tag to a image dynamically generated by PHP?
Does anybody know how to overcome this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
GET 参数只是附加到 URL 末尾的查询字符串。因此,要将参数
foo
和bar
分别设置为42
和cubiculum
,即foo
和bar
中给出的 URL code>IMG 的SRC
属性将以?foo=42&bar=cubiculum
结尾。GET parameters are just the query strings appended to the end of the URL. Thus, to set the parameters
foo
andbar
to42
andcubiculum
, respectively, the URL given in theIMG
'sSRC
attribute would end with?foo=42&bar=cubiculum
.您需要将标志 QSA 添加到 RewriteRule,以在重写后维护 QUERY_STRING网址
You'll need to add the flag QSA to the RewriteRule to maintain the QUERY_STRING after rewriting the URL
这完全合法并且应该完美地工作:
这使查询字符串保持完整:
This perfectly legal and should work flawlessly:
This keeps the query string intact: