How can I get my script to call a different web page in a new browser window? I'm using header("Location: and that works fine, but I need the new file in a second browser window.
Well, you won't be able to do it from within PHP because that is a server-side environment -- and you need this extra window on the client browser. You would need to use something like Javascript to create the new window for you... but there is a problem.
Because the extra window would not be generated by the user specifically clicking the mouse button, the popup blockers on most browsers will prevent the second window from "popping up". At least... that is the default action of these blockers (unless the user initiates it, the browser/toolbar will block it). If this is something for an intranet environment -- then you could certainly manage this problem by changing these settings.
You would have to have Javascript enabled on the client browser and basically echo some javascript to the page in the appropriate location of the html document. This javascript (a single line would do it) would open a new window and load a file (as specified by you when you opened it).
If this even sounds like it would work for your environment, let us know. Any further questions relating to Javascript ought to be directed to the Javascript forum, however (just so you know).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.