On Fri, May 14, 2010 at 8:59 AM, Andrew Ballard <aballard@xxxxxxxxx> wrote: > On Thu, May 13, 2010 at 5:18 PM, Ashley Sheridan > <ash@xxxxxxxxxxxxxxxxxxxx> wrote: > > On Thu, 2010-05-13 at 17:13 -0400, David Mehler wrote: > > > >> Hello, > >> I want to open an external link in a new window, i know i can do this > >> with xhtml, but only with the transitional dtd, which i'm not using. I > >> was wondering if php could pull this off? > >> Thanks. > >> Dave. > >> > > > > > > No. PHP is on the server, not the client-side. If you can't use > > something like target="_blank" in your xhtml, then consider using > > Javascript. It's not the ideal solution, as it won't work where > > scripting is disabled or not available. > > > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > It may or may not be the "ideal" solution, but I'm pretty sure it is > considered the "correct" solution going forward. I recall reading > somewhere that things like controlling the "target" for a link are > considered behavior rather than part of the document's semantic > structure, and therefore belong in scripting rather than markup under > XHTML. That makes sense given that one of the goals of XHTML is > structured documents that can be consumed by multiple services, > including but not exclusively web browsers. > > This also has the side effect that the decision of whether to open a > link in the current window or a new window/tab belongs to the viewer > instead of the author, which some argue is exactly as it should be. > > Andrew > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I'd avoid the target attribute, as it's deprecated in the strict versions (and I'd avoid it for the reasons Andrew mentioned.) For reading, here's a nice resource to start with: http://www.456bereastreet.com/archive/200603/the_target_attribute_and_opening_new_windows/ Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com