PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$windowURL = 'http://www.google.co.uk'; // URL you want the window to open to
$windowName = 'This Title'; // Name of the opened window
// javascript
window.open('<?php echo $windowURL; ?>','<?php echo $windowName; ?>');
from a usability / personal preference POV i personally prefer that it is opened in a new window for a variety of reasons
1) Some PDF's take an age to load
2) I would like the site i was looking at to still be there without having to press the back button
3) This is what a user would expect (i personally would)
I'm kind of torn on the issue. I think it depends on your demographic... Most users don't even know HOW to open a link in a new window. If this is your target audience, and your customer is linking to an external site, I'd say open in a new window... but not a javascript popup, because those often get blocked anyway.
The Ninja Space Goat wrote:.... I'd say open in a new window... but not a javascript popup, because those often get blocked anyway.
Only if they are triggered by events the user didn't invoke (such as onload). If the user opens a popup from an onclick event it shouldn't be blocked. The "target" attribute is no longer valid in XHTML strict.