19 users online (0 members and 19 guests)  

Thread: Php and Iframe


  Results 1 to 4 of 4

Related

  1. IFrame in PHP?    Forum: PHP Forum
    Replies: 1
  2. iframe    Forum: HTML Forum
    Replies: 4
  3. iframe    Forum: HTML Forum
    Replies: 2
  4. Iframe help    Forum: HTML Forum
    Replies: 2
  5. IFRAME    Forum: HTML Forum
    Replies: 14
  1. #1
    Bisware
    Bisware's Avatar
    Guest

    Php and Iframe

    Hello,

    I have am having a big problem.
    Got a webpage which is php and has an iframe on it.

    <iframe src=http://somesite.nl name=main width=100% height=100% scrolling="auto"> </iframe>

    The iframe loads an external site. On that site you can login and it loads some variables in the URL.
    I need those variables in my mainpage. Is there a way to get that url frome the iframe?

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Php + Iframe

    yes, you can use javascript to do it, if it is post data that you are sending... you would need to create a hidden input type, like this:

    <input type="hidden" name="hiddenvalue" value="">

    the javascript you would need to do this:

    <script type="text/javascript">
    document.getElementsByName('hiddenvalue')[0].value = document.getElementsByName('main')[0].src;
    </script>

    then the it would be a variable in the php page like this:

    $_POST['hiddenvalue']

    -ALL

  3. #3
    Bisware
    Bisware's Avatar
    Guest

    Re: Php + Iframe

    Quote Originally Posted by ALL
    yes, you can use javascript to do it, if it is post data that you are sending... you would need to create a hidden input type, like this:

    <input type="hidden" name="hiddenvalue" value="">

    the javascript you would need to do this:

    <script type="text/javascript">
    document.getElementsByName('hiddenvalue')[0].value = document.getElementsByName('main')[0].src;
    </script>

    then the it would be a variable in the php page like this:

    $_POST['hiddenvalue']

    -ALL
    It's not POST data. I need to get the variable PGID from the adress bar. it comes from an external site which i can not modify.

  4. #4
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Php + Iframe

    how do you expect php to get it? are they going to click a link and have it in a GET variable?

    you have to talk to the server to get the client to send it.

    -ALL



Tags for this Thread