Hello,
I've started a del icio us clone web site. I wanted to attach a small "if you like this site bookmark now" message at the top of the external page when anyone click them.
I will reformat the outgoing links from URL to GO.php?URL=URL
I try require() first. At go.php when I call require("$URL") page shows up but relative links and images are broken. I try iframe but I don't want my message always displays (would be ugly). I don't want to use frame either. Can I include aspx or jsp pages too?
What would be the neat way to do this.
Thanks in advance
Including external html but relative links are broken
Moderator: General Moderators
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
I seriously wouldn't go about doing this the way you are. Any external site will be able to exploit XSS - this is use JavaScript to change the meaning of your functionality. The best way of achieving this kind of stuff is with browser plugins failing that frames seem to be good enough for most search engines.
Thinking about it you could probably do this safely by using HTMLPurifier. This would also ensure the HTML was formatted validly for you could match for certain tags/attributes to add the domains and solve your relative URL issue.
Thinking about it you could probably do this safely by using HTMLPurifier. This would also ensure the HTML was formatted validly for you could match for certain tags/attributes to add the domains and solve your relative URL issue.