如何忽略 URL 中的查询字符串?
你好,我有这样的事情:
if(isset($_POST['btnProm'])){
$idads = mysql_real_escape_string($_POST['idAds']);
require_once("adPromFrm.php");
}
当按下按钮时,会出现一个表单......
当我刷新页面时,表单不会消失,但是当我单击带有查询字符串的链接时(thisPage.php?lang =fr...),表格消失。
我知道我仅在按下按钮时才询问表单,但我如何忽略查询字符串。
Hello I have something like this:
if(isset($_POST['btnProm'])){
$idads = mysql_real_escape_string($_POST['idAds']);
require_once("adPromFrm.php");
}
When a button is pressed, a form will appear....
When i refresh the page, the form doesn't disappear, but when i click a link with a query string (thisPage.php?lang=fr...), the form disappears.
I know i m asking the form only if the button is pressed, but how can i ignore the query string.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以考虑使用 会话 来实现此行为。会话数据保存在请求之间,因此单击链接不会导致表单消失。
观察:
You might consider using sessions for this behavior. Session data is held between requests so clicking links won't cause the form to disappear.
Observe: