iframes - how do I detect the page of origin?

Discussion in 'HTML' started by damezumari, Nov 5, 2007.

  1. damezumari

    damezumari Guest

    I want to put an iframe with src file A (a php file) on page B. If
    somebody copies the iframe tag to page C how can I detect that the
    request does not come from page B in my code in A?

    Regards,

    Jan Nordgreen
     
    damezumari, Nov 5, 2007
    #1
    1. Advertising

  2. On Nov 5, 11:29 am, damezumari <> wrote:
    > I want to put an iframe with src file A (a php file) on page B. If
    > somebody copies the iframe tag to page C how can I detect that the
    > request does not come from page B in my code in A?


    Are A&B owned by you and you want to be able to detect if someone is
    trying to launch B from their site (C)?

    OR

    Do you own all three and you want to know if someone is viewing B from
    A or C?
     
    Travis Newbury, Nov 5, 2007
    #2
    1. Advertising

  3. damezumari

    damezumari Guest

    Case 1. I own A&B, not C.
     
    damezumari, Nov 5, 2007
    #3
  4. damezumari

    damezumari Guest

    I found the answer:

    In php $_SERVER['HTTP_REFERER'] returns which page the iframe sits in.
     
    damezumari, Nov 8, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nicol Nghia
    Replies:
    0
    Views:
    360
    Nicol Nghia
    Dec 3, 2005
  2. annie
    Replies:
    1
    Views:
    342
    Andrew Thompson
    Feb 23, 2004
  3. Tom Parson
    Replies:
    7
    Views:
    1,549
    Richard F.L.R.Snashall
    Nov 14, 2005
  4. Si
    Replies:
    4
    Views:
    27,761
    Roedy Green
    Feb 28, 2006
  5. Remy Sharp

    Detect if iframes successfully load

    Remy Sharp, Jul 24, 2003, in forum: Javascript
    Replies:
    0
    Views:
    113
    Remy Sharp
    Jul 24, 2003
Loading...

Share This Page