刷新问题 [英] Refresh Problems

查看:69
本文介绍了刷新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,使用

表单向用户请求索引编号。提交然后调用自己,并且php查找表确定所需的网页,然后跳转。


echo"< script>窗口。 location.href =''$ a''< / script>" ;;


页面详细信息在地址行中传递,并以
$ b结尾$ b POST。一切正常没有问题,


然而,如果用户点击后退按钮,则再次跳转并且

它们所在的页面只是重新加载,就像你一样我会期待的。


我试着查询javascript历史记录,看看我来自哪里

但是没有跳到它就无法获得该位置。如果我来自

除了当前页面之外的任何地方,那么如果我能做的话,那么从逻辑上来说似乎不会跳过工作。


还想过会议,但这似乎是一个大锤来敲打坚果(我也没有必要使用会议所以他们是

未经我的尝试) 。


感激地接受任何其他解决方案或想法。


-

John

解决方案

a''< / script>" ;;


页面的详细信息在地址线并用

POST取消。一切正常没有问题,


然而,如果用户点击后退按钮,则再次跳转并且

它们所在的页面只是重新加载,就像你一样我会期待的。


我试着查询javascript历史记录,看看我来自哪里

但是没有跳到它就无法获得该位置。如果我来自

除了当前页面之外的任何地方,那么如果我能做的话,那么从逻辑上来说似乎不会跳过工作。


还想过会议,但这似乎是一个大锤来敲打坚果(我也没有必要使用会议所以他们是

未经我的尝试) 。


感激地接受任何其他解决方案或想法。


-

John


John写道:

我有一个页面,使用
表单向用户请求索引编号。提交然后调用自己,并且php查找表确定所需的网页然后跳转。

echo"< script> window.location.href =''

一个 '' < /脚本>英寸;


为什么不使用include_once()而不是重定向,如果你使用了header()而不是javascript,那真的有了
更合适

要求客户端启用了javascript,其中一些不应该是安全问题等等。

http://www.php.net/manual/en/function.include-once .php
http:// www.php.net/manual/en/function.header.php


然而,如果用户按下后退按钮,则再次跳转并且
他们所处的页面只是重新加载,如你所料。




这是根据规则


form_page - > redirect_page - > displayed_pa​​ge


当你回来时,你会回到redirect_page然后它会自动将用户重定向回到displayed_pa​​ge,所以你需要得到

摆脱redirect_page然后include_once()会更好用


form_page - > displayed_pa​​ge


你做的事情与以前用javascript做的事情完全相同,

但是不要在页面中输出任何内容问题,除非你想要
生成错误信息。

而不是填充变量


I have a page that requests an index number from the user using a
form. The submit then calls itself and a php lookup table determines
the web page required and then does a jump.

echo "<script>window.location.href=''$a''</script>";

Details of the page are passed in the address line and pulled off with
POST. All works fine no problems,

However if the user hits the back button the jump is made again and
the page they are on simply reloads, as you would expect.

I tried interrogating javascript history to see where I have come from
but cannot get the location without jumping to it. If I came from
anywhere except current page then don''t jump would logically seem to
work if I could do it.

Also thought about sessions but that seems like a sledgehammer to
crack a nut (also I have not had to use sessions yet so they are
untried for me).

Any other solutions or ideas gratefully accepted.

--
John

解决方案

a''</script>";

Details of the page are passed in the address line and pulled off with
POST. All works fine no problems,

However if the user hits the back button the jump is made again and
the page they are on simply reloads, as you would expect.

I tried interrogating javascript history to see where I have come from
but cannot get the location without jumping to it. If I came from
anywhere except current page then don''t jump would logically seem to
work if I could do it.

Also thought about sessions but that seems like a sledgehammer to
crack a nut (also I have not had to use sessions yet so they are
untried for me).

Any other solutions or ideas gratefully accepted.

--
John


John wrote:

I have a page that requests an index number from the user using a
form. The submit then calls itself and a php lookup table determines
the web page required and then does a jump.

echo "<script>window.location.href=''


a''</script>";
why not use an include_once() instead of the redirection, which really had
been more proper if you had used header() instead of the javascript which
requires that the client has javascript enabled which some don''t due security
problems and such.

http://www.php.net/manual/en/function.include-once.php
http://www.php.net/manual/en/function.header.php

However if the user hits the back button the jump is made again and
the page they are on simply reloads, as you would expect.



That is according to the rules

form_page -> redirect_page -> displayed_page

When making a back, you get back to the redirect_page and it will then
automatically redirect the user back to the displayed_page, so you need to get
rid off the redirect_page and then the include_once() will work a lot better

form_page -> displayed_page

You do things quite the same way as you did before with the javascript thing,
but don''t make any outputs in the page in the question, except if you want to
generate error messages.
Instead of populating the variable


这篇关于刷新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆