tags:

views:

304

answers:

3

Hello all,

For a banner management system i use a

 header("Location: http://www.awebsite.com");

to redirect to the proper website. Is it possible to force this header script to open in a new window?

+2  A: 

No. If you want a new window, you have to deliver the redirect as HTML/Javascript.

chaos
Which is gross. And unkind.
anonymous coward
No argument. It's all kind of gross to me once the word 'banner' comes into it.
chaos
And if I can't use js are there other options?
sanders
Obviously the best thing is if you can get a target="_blank" into the original link, like legenden says. (It wasn't thinking you had control over that.) If for some reason you can't push JS to the client (I assume there's a social reason for that, since it's pretty much impossible for there to be a technical reason), you're pretty much out of luck; all you could do would be to send HTML with a link and ask the user to click on it.
chaos
+5  A: 
   <a href='yourbannerscript.php' target='_blank'>...</a>
legenden
A: 

It would be nasty, and might not be want you want, but including an IFRAME tag pointing to a php file with the header redirect could be a solution. Doesn't create a new window, but creates a window-within-a-window.

<iframe src="/myredirectscript.php"></iframe>