Page 1 of 1
includes and css
Posted: Wed Apr 02, 2008 6:09 pm
by bloodl
Hi,
I have a php include which happens to be an external URL. It loads fine, but the css isn't there. I can see why that happened, because the include file is including other files which are relative (such as the css). What do people usually do to get around this? PHP setting? Adidtional includes?
Cheers,
Doug
Re: includes and css
Posted: Wed Apr 02, 2008 7:47 pm
by aceconcepts
You could set an "include from" variable and use it in a conditional statement within the included file.
Re: includes and css
Posted: Wed Apr 02, 2008 9:02 pm
by John Cartwright
preg_replace() on all the urls, and replacing the relative links to absolute links.
However, if you use PCRE I recall there being a a fairly hittable limit to the input size you can input (especially if it's an html page). In that case, I would recommend you split the file into chunks, using file(), array_chunk(), and implode() to reassemble the string.
Re: includes and css
Posted: Wed Apr 02, 2008 11:07 pm
by bloodl
aceconcepts wrote:You could set an "include from" variable and use it in a conditional statement within the included file.
I don't have access to the external file. Are you suggesting that I would need access to the external file to communicate the conditional statement?
Why do frames work so well, but php includes have very slight issues. Can anyone shed some light on this for me
Originally I had a frameset that needed to be dynamic, but i discovered that php includes could do the same thing. Although I think that when the url is external, it encounters complications (so far anyway?)
Confused and frayed
Jcart wrote:preg_replace() on all the urls, and replacing the relative links to absolute links.
However, if you use PCRE I recall there being a a fairly hittable limit to the input size you can input (especially if it's an html page). In that case, I would recommend you split the file into chunks, using file(), array_chunk(), and implode() to reassemble the string.
Im not sure I understand what this would look like? Can you shoot me any code? Im a bit of a newbie
Thanks for your help everyone. Im getting there.
Cheers,
Doug