1 link 2 targets

Discussion in 'PHP' started by KingCobra, May 24, 2009.

  1. #1
    How can I send variable from 1 external link to 2 targets of another page?

    Just see the following picture to understand.

    [​IMG]


    I will click "my link" from pageX.php
    Then it open page1.php with page2.php (inside iframe)
    Both page1.php & page2.php will get value from pageX.php
     
    KingCobra, May 24, 2009 IP
  2. WeedGrinch

    WeedGrinch Active Member

    Messages:
    1,236
    Likes Received:
    73
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Use GET. have page1.php store the variable of $_GET['whatever'], have the iframe URL load that.
     
    WeedGrinch, May 24, 2009 IP
  3. sssharlasss

    sssharlasss Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sounds about right.

    You'll have to put the variable in your link.

    For example: example.com/script.php?variable=neato.txt

    Then, you would use WeedGrinch's suggestion and get the variable like so:

    
    <?php
    
    $variable = $_GET['variable'];
    
    echo $variable; //Prints "neato.txt"
    ?>
    
    Code (markup):
     
    sssharlasss, May 25, 2009 IP