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
includes and css
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: includes and css
You could set an "include from" variable and use it in a conditional statement within the included file.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: includes and css
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.
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
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?aceconcepts wrote:You could set an "include from" variable and use it in a conditional statement within the included file.
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
Im not sure I understand what this would look like? Can you shoot me any code? Im a bit of a newbieJcart 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.
Thanks for your help everyone. Im getting there.
Cheers,
Doug