Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a new page

Status
Not open for further replies.

Tourex

Technical User
Apr 28, 2005
1
GB
I'm a newbie to PHP, so please bear with me.

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.

Any clues anyone? TIA.
 

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).

Cheers,
Jeff

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top