Results 1 to 8 of 8

Thread: Multiple Links

  1. #1
    Join Date
    Jan 2004
    Posts
    17

    Unanswered: Multiple Links

    Hi,
    I am wondering if there is away of opening two different pages in new windows from one hyperlink in PHP ?

    The only way I could think of was to open one page with the other being opened automatically from it, but again how do I do that in PHP ??

    Thanks,
    Phil.

  2. #2
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    you could send the link to something like "doublelink.php?1=http://this.com&2=http://that.com" then have a page that does some javascript to open both pages.
    Mr. Lars

  3. #3
    Join Date
    Jan 2004
    Posts
    17
    Yea,
    The problem is I am also passing a variable from the first page to the other two, thats why Im doing it in PHP.
    All three pages are dynamically derived from a Mysql database.

    When I tried to use the method you described I couldnt seem to pick up the contents of the variable.


    Phil.

  4. #4
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    couldn't you do something like this?...

    openlinks.php?1=http://this.com&2=http://that.com
    Code:
    <?php
    // Connect to database and get link info for the links
    ?>
    
    <script language="JavaScript">
    <!--
    window.open('<?php echo $linkone; ?>','window name')
    window.open('<?php echo $linktwo; ?>','window name')
    //-->
    </script>
    Mr. Lars

  5. #5
    Join Date
    Jan 2004
    Posts
    17
    Hmm,
    What Im trying to do is refresh two frames in the same window, so Im not sure if window.open is the correct function as it always seems to open a new window even whenI specify the fram target.
    I need to pass a variable to the two links as well.

    Thanks,

  6. #6
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    Code:
    <SCRIPT language="JavaScript">
    <!--
    parent.FRAMENAME.location="<?php echo $linkone; ?>";
    parent.FRAMENAME.location="<?php echo $linktwo; ?>";
    //-->
    </SCRIPT>
    Mr. Lars

  7. #7
    Join Date
    Jan 2004
    Posts
    17
    Excellent !!

    Works perfectly, thankyou.

    Phil.

  8. #8
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    Great! No problem!
    Mr. Lars

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •