By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,730 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,730 IT Pros & Developers. It's quick & easy.

Speed Bumps

P: n/a
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page to come
up that says you are leaving my site, with an OK button. once the OK button
is clicked I want to go to the original link that was clicked on.

any ideas.
May 12 '06 #1
Share this Question
Share on Google+
17 Replies


P: n/a

<sl****@charter.net> wrote in message
news:44**********************@news.astraweb.com...
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page to come up that says you are leaving my site, with an OK button. once the OK button is clicked I want to go to the original link that was clicked on.

any ideas.


It feels like my eyes being removed by chopsticks.
May 13 '06 #2

P: n/a
sl****@charter.net wrote:
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page to come
up that says you are leaving my site, with an OK button. once the OK button
is clicked I want to go to the original link that was clicked on.

any ideas.


Can't do it. The external link will go to the other server. Your server won't
even know it happened.

And you should ask in alt.html. This isn't a PHP question (since PHP is
server-side only).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 13 '06 #3

P: n/a
This isn't PHP, but you'd probably want to use JavaScript.
Try something like this (attributes removed for readability):

<html>
<head>
<script>
function speedBump(){
/*---------Code to delay exit--------*/
}
</script>
</head>
<body onunload="speedBump()">
</body>
</html>

May 13 '06 #4

P: n/a
sl****@charter.net wrote:
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page to come
up that says you are leaving my site, with an OK button. once the OK button
is clicked I want to go to the original link that was clicked on.
You're trying to slow down the people who are "leaving" by
second-guessing them? (Metaphors are fun but can mislead: I can
follow an external link without "leaving" your page.) In a world where
people are always in a rush, standing in their way could well earn you
a punch in the nose!
any ideas.


Pub?

--
Jock

May 13 '06 #5

P: n/a
I think a better option would to use framing, have your own top frame saying
it aint your website, and maybe a link to go back to your website. An
option?

<sl****@charter.net> wrote in message
news:44**********************@news.astraweb.com...
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page to
come
up that says you are leaving my site, with an OK button. once the OK
button
is clicked I want to go to the original link that was clicked on.

any ideas.

May 13 '06 #6

P: n/a
Carved in mystic runes upon the very living rock, the last words of
<sl****@charter.net> of comp.lang.php make plain:
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page
to come up that says you are leaving my site, with an OK button. once
the OK button is clicked I want to go to the original link that was
clicked on.

any ideas.


Yep -- don't do it. It can be done quite easily with PHP, but if I were
on your site and ran into your "speed bump", I doubt I'd be back. If I
clicked the link in the first place, that's where I want to go. Making me
click again is only going to be annoying.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 13 '06 #7

P: n/a
Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.php make plain:
Carved in mystic runes upon the very living rock, the last words of
<sl****@charter.net> of comp.lang.php make plain:
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page
to come up that says you are leaving my site, with an OK button.
once the OK button is clicked I want to go to the original link that
was clicked on.

any ideas.


Yep -- don't do it. It can be done quite easily with PHP, but if I
were on your site and ran into your "speed bump", I doubt I'd be back.
If I clicked the link in the first place, that's where I want to go.
Making me click again is only going to be annoying.


Actually, upon further consideration, I can think of a situation where it
might be valid, if you want to make it clear that the visitor is leaving
your site, and you have no connection with the site they're going to. For
example, if you were writing an article on hate groups, and wanted to
link to some of their sites.

So, just write a script that takes a URL in the query string, display
your warning, and output the URL in a link. Then link to that in your
article or whatever.

But if it's just for, "Aww, shucks -- are you sure you want to leave my
excellent site????" -- don't do it. You will be regarded with contempt by
your visitors.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 13 '06 #8

P: n/a
Rik
Alan Little wrote:
Carved in mystic runes upon the very living rock, the last words of
Alan Little of comp.lang.php make plain:
Carved in mystic runes upon the very living rock, the last words of
<sl****@charter.net> of comp.lang.php make plain:
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page
to come up that says you are leaving my site, with an OK button.
once the OK button is clicked I want to go to the original link that
was clicked on.

any ideas.


Yep -- don't do it. It can be done quite easily with PHP, but if I
were on your site and ran into your "speed bump", I doubt I'd be
back. If I clicked the link in the first place, that's where I want
to go. Making me click again is only going to be annoying.


Actually, upon further consideration, I can think of a situation
where it might be valid, if you want to make it clear that the
visitor is leaving your site, and you have no connection with the
site they're going to. For example, if you were writing an article on
hate groups, and wanted to link to some of their sites.


Another valid reason would be a (more or less secure) "logged in" area, and
displaying a warning you're leaving that area.
It could be done in PHP, but it would mean converting all your links, which
is a hassle. A quick temporary solution would be to turn on outbut
buffering, and searsching replacing links with preg_replace(). It's not
something I'd choose as a permanent solution though, it's unneccesary extra
memory and processing compared to doing it correctly.

Grtz,
--
Rik Wasmus
May 13 '06 #9

P: n/a
sl****@charter.net wrote:
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page to come
up that says you are leaving my site, with an OK button. once the OK button
is clicked I want to go to the original link that was clicked on.

any ideas.


<a href="http://www.google.com/" onClick="alert('You are about to leave
this site.')">Go To Google</a>

Regards

May 13 '06 #10

P: n/a
John Dunlop wrote:
You're trying to slow down the people who are "leaving" by
second-guessing them? (Metaphors are fun but can mislead: I can
follow an external link without "leaving" your page.) In a world where
people are always in a rush, standing in their way could well earn you
a punch in the nose!


It's a common practice for government sites. The idea is that people
need to know they will no longer be looking at official information.

There is also a security dimension. Such a page helps ensure that
you're not leaking sensitive information through the HTTP referrer
field.

May 13 '06 #11

P: n/a
ah
In article <11**********************@v46g2000cwv.googlegroups .com>,
ch***********@hotmail.com says...
John Dunlop wrote:
You're trying to slow down the people who are "leaving" by
second-guessing them? (Metaphors are fun but can mislead: I can
follow an external link without "leaving" your page.) In a world where
people are always in a rush, standing in their way could well earn you
a punch in the nose!


It's a common practice for government sites. The idea is that people
need to know they will no longer be looking at official information.

There is also a security dimension. Such a page helps ensure that
you're not leaking sensitive information through the HTTP referrer
field.


Just one more example of what an appaling incompetent mess the HTML world
is.

sigh.
May 13 '06 #12

P: n/a
Chung Leong:
It's a common practice for government sites. The idea is that people
need to know they will no longer be looking at official information.
The idea sounds fine to me, and I would even extend it further than
government webpages. I would have *all* links as clear as possible, so
that the relationship between the current page and the linked-to one is
obvious. (Unless there is some reason to obscure that relationship;
none spring to mind.)

I would still take issue with the setting up of a middle page to
achieve that end though, but from a user's perspective I can't offer
much in the way of argument other than my own opinion that it would be
a nuisance being presented with an 'are you sure?' (said in a Mrs Doyle
from /Father Ted/ voice) each time I followed an external link.

Besides, external links can be set apart in other ways. For example,
the title attribute of the link (e.g., title="EXTERNAL LINK: ... "),
the rel attr. (e.g., rel="external", with a suitable Profile), the
surrounding text (e.g., explain in the prose what the link is), and the
style of the link (e.g., an image after every external link). Those
can be combined to make the relationship between the two pages more
explicit.
There is also a security dimension. Such a page helps ensure that
you're not leaking sensitive information through the HTTP referrer
field.


Good call, hadn't thought of that. RFC2616 mentions it.

I think we would need to distinguish intra- from internet then.

--
Jock

May 14 '06 #13

P: n/a
John Dunlop wrote:
Chung Leong:
It's a common practice for government sites. The idea is that people
need to know they will no longer be looking at official information.
The idea sounds fine to me, and I would even extend it further than
government webpages. I would have *all* links as clear as possible, so
that the relationship between the current page and the linked-to one is
obvious. (Unless there is some reason to obscure that relationship;
none spring to mind.)

I would still take issue with the setting up of a middle page to
achieve that end though, but from a user's perspective I can't offer
much in the way of argument other than my own opinion that it would be
a nuisance being presented with an 'are you sure?' (said in a Mrs Doyle
from /Father Ted/ voice) each time I followed an external link.


Perhaps the middle page could be used to describe the external link in
more detail so the user can decide if it's worth the time to load the
page. The javascript option I posted can descibe in more detail the
external link, graphic intensive, only suitable for a articular browser
etc... or the other option is a middle page, and that doesn't require
anything more advanced than standard html 4.01.

But obviously there is a valid use for an option to decline loading the
external link.


Besides, external links can be set apart in other ways. For example,
the title attribute of the link (e.g., title="EXTERNAL LINK: ... "),
the rel attr. (e.g., rel="external", with a suitable Profile), the
surrounding text (e.g., explain in the prose what the link is), and the
style of the link (e.g., an image after every external link). Those
can be combined to make the relationship between the two pages more
explicit.
There is also a security dimension. Such a page helps ensure that
you're not leaking sensitive information through the HTTP referrer
field.


Good call, hadn't thought of that. RFC2616 mentions it.

I think we would need to distinguish intra- from internet then.

--
Jock


May 15 '06 #14

P: n/a
newsreader wrote:
sl****@charter.net wrote:
anyone know how to set up a 'speed bump'.

once someone clicks on an external link on my website, I want a page to come
up that says you are leaving my site, with an OK button. once the OK button
is clicked I want to go to the original link that was clicked on.

any ideas.


<a href="http://www.google.com/" onClick="alert('You are about to leave
this site.')">Go To Google</a>

Regards

why not just have target="blank" in the HTML - that way they still have
your site

Margaret
May 15 '06 #15

P: n/a
Den 15.05.2006 14:49, skriblet Margaret Willmer følgende:

why not just have target="blank" in the HTML - that way they still have
your site


Because the "target"-attribute is deprecated, and really shouldn't be
used. But of course, if one still lives in the world of HTML 4.01
Transitional, then go ahead...

Why can't designers just trust people to be able to use either CTRL or
SHIFT-click when they push a link, if they want to open another instance?

--
mvh
Ørjan Langbakk
http://www.bergenpchjelp.no
May 16 '06 #16

P: n/a
Rik
Ørjan Langbakk wrote:
Why can't designers just trust people to be able to use either CTRL or
SHIFT-click when they push a link, if they want to open another
instance?


Because people are spoiled, and assume it's taken care off?

Grtz,
--
Rik Wasmus
May 16 '06 #17

P: n/a
Den 16.05.2006 20:54, skriblet Rik følgende:
Ørjan Langbakk wrote:
Why can't designers just trust people to be able to use either CTRL or
SHIFT-click when they push a link, if they want to open another
instance?


Because people are spoiled, and assume it's taken care off?


Ie. they're stupid, you mean? ;-)

--
mvh
Ørjan Langbakk
http://www.bergenpchjelp.no
May 17 '06 #18

This discussion thread is closed

Replies have been disabled for this discussion.