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

Show an advisory "Going to External Link" while the user is going out of my domain

P: 48
Hi,

I have my website and want to perform this functionality most likely using PHP. Please note that the website is huge and manual editing of pages is not possible.

Is there a quick solution tom implement an advisory or an intermediate message like "You are not leaving www.xxxxx. domain and going to external website" when a user clicks on any "external" link on my website?

Thanks,
AJ
Feb 8 '08 #1
Share this Question
Share on Google+
3 Replies


hsriat
Expert 100+
P: 1,654
Hi,

I have my website and want to perform this functionality most likely using PHP. Please note that the website is huge and manual editing of pages is not possible.

Is there a quick solution tom implement an advisory or an intermediate message like "You are not leaving www.xxxxx. domain and going to external website" when a user clicks on any "external" link on my website?

Thanks,
AJ
That can't be done in server side scripting.
You need to add some javascript code....

use something like this....

on ONCLICK event of every link, you may need to add this....

Expand|Select|Wrap|Line Numbers
  1. if (location.hostname!='yourwebsite.com')
  2. alert ('You are going out of my site, baby...');
I'm not sure about the syntax. Do confirm it.
Feb 10 '08 #2

P: 48
That can't be done in server side scripting.
You need to add some javascript code....

use something like this....

on ONCLICK event of every link, you may need to add this....

Expand|Select|Wrap|Line Numbers
  1. if (location.hostname!='yourwebsite.com')
  2. alert ('You are going out of my site, baby...');
I'm not sure about the syntax. Do confirm it.
Oh, that means change all the files anyways. I hoped there was an easy solution. thanks a lot for your help. No issues with the syntax, with so many languages it has become a pain anyways to learn that.
Feb 10 '08 #3

Markus
Expert 5K+
P: 6,050
Oh, that means change all the files anyways. I hoped there was an easy solution. thanks a lot for your help. No issues with the syntax, with so many languages it has become a pain anyways to learn that.
Are your pages served dynamically or file...ly ?
Feb 10 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.