disabling the customer from using url inside iframe

Last post 07-09-2008 11:33 AM by HeartattacK. 9 replies.

Sort Posts:

  • disabling the customer from using url inside iframe

    07-08-2008, 12:53 PM
    • Member
      247 point Member
    • Crewe2008
    • Member since 09-26-2007, 2:02 PM
    • Posts 112

    I have a requirement to stop user from picking the url inside the iframe and accessing it directly. I want to know if its possible anyway.

    Thanks in advance.

    ~ Remember To Mark The Posts Which Helped You As The ANSWER ~
  • Re: disabling the customer from using url inside iframe

    07-08-2008, 1:54 PM
    • All-Star
      76,951 point All-Star
    • NC01
    • Member since 08-26-2005, 3:33 PM
    • Posts 14,335
    • TrustedFriends-MVPs

    Why do you have the URL in the iFrame then? Just remove it.

    NC...

  • Re: disabling the customer from using url inside iframe

    07-08-2008, 10:31 PM
    • Contributor
      5,089 point Contributor
    • NHOQUE
    • Member since 04-02-2008, 9:00 AM
    • Kumamoto, Japan
    • Posts 849

    I think Crewe2008 wants to stop accessing his developed webpage in an iframe. Am I right?

    For example, any user can access http://www.yahoo.com in an iframe. Now if Yahoo wants to stop the accesing Yahoo in an Iframe, what will be the way?

    Thanks.

    HOQUE MD.NAZMUL
    [document.getReaders]
  • Re: disabling the customer from using url inside iframe

    07-08-2008, 11:32 PM
    • All-Star
      30,502 point All-Star
    • HeartattacK
    • Member since 01-08-2007, 12:53 PM
    • Dhaka, Bangladesh
    • Posts 3,292
    • Moderator

    I don't think that's possible. Infact, I'm pretty sure it's not possible.

    All that glitters is gold-
    Only shooting stars break the mold.

    Read my blog: www.heartysoft.com

    Tell me what tutorials / articles / videos you want to see on my site.
  • Re: disabling the customer from using url inside iframe

    07-09-2008, 12:40 AM
    • Contributor
      4,524 point Contributor
    • deesh1531982
    • Member since 12-24-2007, 1:15 PM
    • Posts 769

    if the url is your page then disable rightclick option on your page so that we cannot have your url..

    "Never underestimate the power of stupid people in large groups"
  • Re: disabling the customer from using url inside iframe

    07-09-2008, 7:59 AM
    • All-Star
      76,951 point All-Star
    • NC01
    • Member since 08-26-2005, 3:33 PM
    • Posts 14,335
    • TrustedFriends-MVPs

    deesh1531982:

    if the url is your page then disable rightclick option on your page so that we cannot have your url..

    That won't work as their are other ways to do the same as executing a right click, also they can just take the URL from the Address bar in the browser, among many other ways.

    I think that HeartattacK is correct. There is no tried an true way. My question is why would you care how someone displays your page?

    NC...

  • Re: disabling the customer from using url inside iframe

    07-09-2008, 8:46 AM
    • All-Star
      30,502 point All-Star
    • HeartattacK
    • Member since 01-08-2007, 12:53 PM
    • Dhaka, Bangladesh
    • Posts 3,292
    • Moderator

    Even if it's in an iframe, it'll still count as a hit for your page. So I can't see a problem of someone putting your site in their iframe. Actually, if someone does that, more power to you - you made something others want to use :)

    All that glitters is gold-
    Only shooting stars break the mold.

    Read my blog: www.heartysoft.com

    Tell me what tutorials / articles / videos you want to see on my site.
  • Re: disabling the customer from using url inside iframe

    07-09-2008, 10:36 AM
    • Member
      247 point Member
    • Crewe2008
    • Member since 09-26-2007, 2:02 PM
    • Posts 112

    You got it wrong totally. In my website I have an iframe which points to another website. But what I want is stop people from getting the url from this iframe and browse it directly. Say www.crewe2008.com is having an iframe which points to www.xyz.com then I dont want users to use www.xyz.com directly from their browser.

    ~ Remember To Mark The Posts Which Helped You As The ANSWER ~
  • Re: disabling the customer from using url inside iframe

    07-09-2008, 11:18 AM
    Answer
    • All-Star
      76,951 point All-Star
    • NC01
    • Member since 08-26-2005, 3:33 PM
    • Posts 14,335
    • TrustedFriends-MVPs

    Like has been posted earlier, there is no real way to do that since any user with knowledge can always view the HTML source . See http://www.dynamicdrive.com/dynamicindex9/noright.htm for a partial solution.

    NC...

     

  • Re: disabling the customer from using url inside iframe

    07-09-2008, 11:33 AM
    Answer
    • All-Star
      30,502 point All-Star
    • HeartattacK
    • Member since 01-08-2007, 12:53 PM
    • Dhaka, Bangladesh
    • Posts 3,292
    • Moderator

    You could make it quite hard for the user to get the url, but it'll require more coding. What you can do is give the iframe an id and on load of the page on the client side, you can call a webservice via AJAX and get the url. You can then use document.getElementById('iframe_id').src = url returned by web service.

    You can make the web service require some data on the page in order to return the url. That might make it harder to get the url by other means. This is not foolproof, but is pretty good.

    All that glitters is gold-
    Only shooting stars break the mold.

    Read my blog: www.heartysoft.com

    Tell me what tutorials / articles / videos you want to see on my site.
Page 1 of 1 (10 items)