When you include a page from another php page on a different domain all the images and links are relative, so none f them work. Is there any way to fix this aside from writting a script that searches for common references (src=,href=,...). Because If I do that, javascripts urls will be much harder. Is there a way to get the file with absolute paths?
When files are included the source targets are originating from the folder that the script that includes the file is in. Example, say you have the main script in /fun and the include in /fun/includes.
In the included script you have to set all of the non-absolute links to show as if the script was in the /fun folder. so if your images folder is /images the image links in the main script as well as the unclude have to be images/file.ext.
You're probably setting the images like ../images/file.ext in the include file. Or so thats what it seems.
if you had to add "http://domain.whatever/folder/folder before each image that didn't have that, you'd need some form of clever regex.
a sneaky (and also untested) workaround it to sling a <base href=" at the top of their included output - that should ignore hrefs and srcs that start http and just effect the rest.