php header location target new window

Status
Not open for further replies.

Seria

PC Cutie ^_^
Messages
553
Hey everybody ^_^

wow, its been a long time since my last post.

Well, im working with a friend designing a website and we have a little problem.

I know what in html, I can create a link that, when clicked, will open a new browser window and load the href's url in that window (target="_blank")

however, I am using php and I just can't figure out how to get that same(opening in a new window) thing to work with a header function (header("Location: http://www.mysite.com"))

This is what I thought would work:
header("Location: http://www.mysite.com target: "_blank"")
I have tried every variation of that and nothing I do works.

I've tried google, I've read books.... and I just cant find the answer

PLEASE PLEASE, what is the syntax to place a (target=”new window”) in a php header function?
 
You can't. PHP is a server-side language, it cannot control the browser. Use Javascript or HTML.
 
darn.

This is essentially what I am trying to do.

Scenario:

a web page that has a form($MainPage). That forms action $_POSTs the users input to a page with no visual html($WindowA) this page simply uses php to processes the users input.

If certain conditions are met, then a header function is called to direct the browser to a new url,
If other conditions are met, then a header function(java or html) is called to open a new window($WindowB), direct $WindowB to a new url and to re-direct $WindowA back to $MainPage

how would I use java or html to preform something like this? I cannot use a regular href tag because I need code to actually link the user to a new location... It will defeat my purpose if the user must actually click on a href link.
 
Try a meta redirect.

Code:
<META http-equiv="refresh" content="1;URL=http://google.com" target="_blank">
 
Status
Not open for further replies.
Back
Top Bottom