Let's say my site is www.domain.com and I want to add a link to it that goes to www.domain123.com. When a person clicks the link and gets to www.domain123.com, I want all links on THAT site to be disabled, and I want the only way for the person to get out of www.domain123.com is by click Back (<----) to my site. How can I do this? Its creating a dead end on www.domain123.com, but I dont have access to www.domain123.com's files because its not mine.

Recommended Answers

All 3 Replies

I want to take control of my visitors' computers.

Write a Web browser that supports this somehow, and then ask your users to download this Web browser, and see if they like it.

Well, there might be a way to do that... but it's not something I'd ever do, so I haven't investigated it. I strongly discourage you from doing this, for several reasons. Perhaps the most important, it would violate user expectations. A user expects to be able to click hyperlinks. Finding themselves suddenly unable to do so, they'd most likely close the browser, rather than clicking "back". Also, it is probably unethical, though I'm willing to give you the benefit of a doubt and assume you have a perfectly honest and valid reason for wishing to do this.

That said, look into "screen-scraping". You could get the content of the target site, and output it into a new window, with your own code to attached (such as a CSS style that set all anchor tags to "display: none"). You'll need server-side code for that.

I'm pretty sure that JavaScript won't work, because browsers won't "trust" or allow a script to run across domains.

You could put their site in an iframe and then position something transparent above the iframe. (And then your visitors wonder why they can't scroll.) Then you could expect a C&D in the mail.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.