强制用户到另一个页面 [英] Force user to another page

查看:63
本文介绍了强制用户到另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我怎么去强迫用户从一个页面到另一个页面?


我有一个非常简单的随机问题/答案入口要求

电子邮件表格。 3页浏览后,大多数人都会成功提交他们的电子邮件(输入/验证为人类,输入

消息,发送消息)。如果有人或某事决定开始

敲打任何一个页面并将视图数量增加太多我想要

将它们踢出一个解释性页面(以防万一)它确实是一个很小的老太太或其他什么。

计算视图并获得错误状态很容易。但是我该如何使用
强制访问者关于那个解释性的页面?


还是有更好的方法来处理这种情况吗?

或者有什么方法可以轻易地将它们与我的网站断开连接吗? />
我想过使用睡眠或睡眠但是...不确定

可能有多可靠,它可能真的是PO一些可怜的小老太太。

这是针对非营利机构的网站,所以我需要温和
如果我可以< g> ;.


TIA,


Twayne


Hi,

How would I go about "forcing" a user from one page to another?

I have a very simple random question/answer entrance requirement for an
e-mail form. After 3 page views most people are going to have
successfully submitted their e-mail (enter/validate as human, enter
message, send the message). If someone or something decides to start
banging on any of the pages and increses the views count too far I want
to kick them out to an explanatory page (just in case it''s really a
little old lady or whatever).
Counting views and getting the error state is easy. But how do I
"force" the visitor off to that "explanatory" page?

Or is there a better way to treat this situation?
Or is there any way to easily just disconnect them from my site somehow?
I thought about using sleep or usleep but ... not sure how reliable that
might be and it could really PO some poor little old lady.
This is for a non-profit agency''s web site so I need to be "gentle"
if I can<g>.

TIA,

Twayne



推荐答案

Twayne写道:
Twayne wrote:




我怎样才能强迫用户从一个页面到另一个页面?


我有一个非常简单的随机问题/答案入口要求

电子邮件表格。 3页浏览后,大多数人都会成功提交他们的电子邮件(输入/验证为人类,输入

消息,发送消息)。如果有人或某事决定开始

敲打任何一个页面并将视图数量增加太多我想要

将它们踢出一个解释性页面(以防万一)它确实是一个很小的老太太或其他什么。

计算视图并获得错误状态很容易。但是我该如何使用
强制访问者关于那个解释性的页面?


还是有更好的方法来处理这种情况吗?

或者有什么方法可以轻易地将它们与我的网站断开连接吗? />
我想过使用睡眠或睡眠但是...不确定

可能有多可靠,它可能真的是PO一些可怜的小老太太。

这是针对非营利机构的网站,所以我需要温和
如果我可以< g> ;.


TIA,


Twayne



Hi,

How would I go about "forcing" a user from one page to another?

I have a very simple random question/answer entrance requirement for an
e-mail form. After 3 page views most people are going to have
successfully submitted their e-mail (enter/validate as human, enter
message, send the message). If someone or something decides to start
banging on any of the pages and increses the views count too far I want
to kick them out to an explanatory page (just in case it''s really a
little old lady or whatever).
Counting views and getting the error state is easy. But how do I
"force" the visitor off to that "explanatory" page?

Or is there a better way to treat this situation?
Or is there any way to easily just disconnect them from my site somehow?
I thought about using sleep or usleep but ... not sure how reliable that
might be and it could really PO some poor little old lady.
This is for a non-profit agency''s web site so I need to be "gentle"
if I can<g>.

TIA,

Twayne





查看header()函数打电话,特别是标题(''位置:....'');


sleep()除了勾选你的用户之外什么都不做,因为他们

不会回页。


-

=============== ===

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================

Look at the header() function call, specifically header(''Location:....'');

sleep() won''t do anything other than tick off your users because they
won''t get a page back.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================



查看header()函数调用,特别是header(''Location:....'');
Look at the header() function call, specifically header(''Location:....'');



关于header()的另一个注意事项 - 你不应该调用header()

除非没有输出其他文本你的剧本了。换句话说,

确定是否在为用户生成

的任何部分之前使用header()重定向。为了更好的衡量,请稍后调用exit()

确保没有其他任何内容被执行。


<?php

/ /重定向用户

标题("位置:redirect_page.html");

退出();

?>


Best,

Michael

An additional word of caution about header() -- you should not call header()
unless no other text has been output by your script yet. In other words,
determine whether or not to redirect with header() before producing any part of
the readable page for your users. For good measure, call exit() afterward to be
sure nothing else gets executed.

<?php
// Redirect user
header("Location: redirect_page.html");
exit();
?>

Best,
Michael


Michael Berkowski写道:
Michael Berkowski wrote:

>
>

>查看header()函数调用,特别是header(''Location:....'');
>Look at the header() function call, specifically header(''Location:....'');



关于header()的另一个警告 - 你不应该调用

header(),除非没有输出其他文本你的剧本了。用

换句话说,确定是否在使用header()之前重定向
,为用户生成可读页面的任何部分。好的

测量,之后调用exit()以确保没有其他任何东西被执行。


<?php

/ /重定向用户

标头(" Location:redirect_page.html");


An additional word of caution about header() -- you should not call
header() unless no other text has been output by your script yet. In
other words, determine whether or not to redirect with header() before
producing any part of the readable page for your users. For good
measure, call exit() afterward to be sure nothing else gets executed.

<?php
// Redirect user
header("Location: redirect_page.html");



没有HTTP响应代码?

No HTTP response code?


exit();

? >
exit();
?>



我对标题的工作原理有点困惑。它只是一个

回声吗?我假设当服务器解析一个页面时,它必须发送一些

内容类型,可能是:Content-type:text / html。解析器

等到它看到之前没有发送头文件吗?


另外,那么setcookie怎么样呢?标题?


我用PHP还没有这么远...

I''m a little confused by how header works. Is it pretty much just an
echo? I''m assuming when a server parses a page, it has to send some
content-type out, probably: Content-type: text/html. Does the parser
wait until it sees that no header is being sent before it does that?

Also, what about setcookie, does that implicitly call something like header?

I haven''t gotten this far with my PHP yet...


>

Best,

Michael
>
Best,
Michael


这篇关于强制用户到另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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