RE: What determines the relative directory, and can I control it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Can I somehow manipulate any of the PHP scripts involved so that the 
HTML within layout.php will look first in it's own directory for 
inclusion of files, such as CSS and javascript and anything else?
[/snip]

If a user accesses http://site.com/index.php, then the HTML that is spit
back out from requesting index.php better have CSS import statements
that point to where the CSS files really are.  

Example:

Requesting http://site.com/index.php returns

<script type="text/css">
 @import a.css
</script>

Then there better be the following:
http://site.com/a.css

There is no way around that (AFAIK), because that is how the web
browsers find such CSS sheets.  In a simplified explanation, they look
for the path of the import, append it to where the request was filed,
and download whatever they get.

You can make it easier on the designer though, in by telling them they
must do something like:

<script type="text/css">
 @import $path.'a.css'
</script>

Then YOUR php files can determine whatever $path needs to be before it
includes the file.

So when they request http://site.com/index.php, it will spit out:

<script type="text/css">
 @import styles/site1/a.css
</script>

I hope this makes sense.

-Logan 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux