1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP script to open 2 pages

Discussion in 'Making Money' started by aeLED, Jun 15, 2010.

  1. aeLED

    aeLED BANNED BANNED

    Joined:
    Dec 16, 2009
    Messages:
    223
    Likes Received:
    45
    Hi,

    Anyone knows, a php script or html to open 2 links?

    like 1 link open 2 windows.
     
  2. yeahright

    yeahright Registered Member

    Joined:
    Jan 17, 2009
    Messages:
    93
    Likes Received:
    32
    The only way to do that is through javascript.

    HTML:
    <a href="http://primarylink.com" onclick="window.open('http://primarylink.com');window.open('http://secondarylink.com');return false;">Click Here</a>
     
    • Thanks Thanks x 1
  3. Nitros

    Nitros Power Member

    Joined:
    Jan 30, 2009
    Messages:
    573
    Likes Received:
    295
    Use javascript:

    Header section

    Code:
    <script type="text/javascript">
    function open() {
        window.open("http://www.yourlink.com/")
        window.open("http://www.yourlink.com/")
    }
    </script>
    
    Body section:

    Code:
    <body onload="open()">
    ;)
     
    • Thanks Thanks x 1
  4. aeLED

    aeLED BANNED BANNED

    Joined:
    Dec 16, 2009
    Messages:
    223
    Likes Received:
    45
    Ok thanks, i will give a try ;)
     
  5. aeLED

    aeLED BANNED BANNED

    Joined:
    Dec 16, 2009
    Messages:
    223
    Likes Received:
    45
    Can you do a document with this nitros?
     
  6. yeahright

    yeahright Registered Member

    Joined:
    Jan 17, 2009
    Messages:
    93
    Likes Received:
    32
    The solution Nitros posted works (if you change the functions name from open() to something like openit()), however will be blocked by almost all modern browsers (ie, ff, chrome, etc...).

    You can't generate a standard popup through onload methods these days without it being blocked. You need user interaction such as a click.
     
  7. aeLED

    aeLED BANNED BANNED

    Joined:
    Dec 16, 2009
    Messages:
    223
    Likes Received:
    45
    Hum..So user need to click on the link to can work? Its impossible to generate a code to auto click that link?
     
  8. yeahright

    yeahright Registered Member

    Joined:
    Jan 17, 2009
    Messages:
    93
    Likes Received:
    32
    No not impossible, just not standard. I'd have to do some tinkering before I could come up with a solution.
     
  9. aeLED

    aeLED BANNED BANNED

    Joined:
    Dec 16, 2009
    Messages:
    223
    Likes Received:
    45
    humm ok.

    Im thinking now, and and script to open a website when user click to close the window? Like user try to close page1, and open the page 2, try to close the page 2 and open the page3...something like that
     
  10. yeahright

    yeahright Registered Member

    Joined:
    Jan 17, 2009
    Messages:
    93
    Likes Received:
    32
    Yeah that should work (I think), can use onunload for that. You should be able to google onunload for some examples if you need to or just change Nitros' code above.