PHP script to open 2 pages

aeLED

BANNED
Joined
Dec 16, 2009
Messages
223
Reaction score
29
Hi,

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

like 1 link open 2 windows.
 
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>
 
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()">
;)
 
Ok thanks, i will give a try ;)
 
Can you do a document with this nitros?
 
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.
 
Hum..So user need to click on the link to can work? Its impossible to generate a code to auto click that link?
 
Hum..So user need to click on the link to can work? Its impossible to generate a code to auto click that link?

No not impossible, just not standard. I'd have to do some tinkering before I could come up with a solution.
 
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
 
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.
 
Back
Top