Force target="_parent" using include?

Hello,

Not sure if this is possible

I have a html page I want to add to a page using an include:


include('file.inc');

Now I know this is depreciated, but is there any way to force all the links on file.inc to be read so that all links have a target=“_parent” without changing file.inc to force this to happen?

Thanks

You could open the file with an XML parser, and them add that attribute to all of the links and output the result.

However, I have to ask - why not just put that on all links by default?

If this is purely a feature rather than a requirement, a JQuery (JS) solution could be devised which would certainly reduce the load on your server. Of course, this limits the functionality to JS-only browsers, but it saves code and improves PHP performance.