Re: best way to specify path to a file in a $variable?
| From: | Tristan dot Pretty at risk dot sungard dot com | Date: | Tue, 30 Dec 2003 14:37:20 +0000 |
| Subject: | Re: best way to specify path to a file in a $variable? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173482@lists.php.net to get a copy of this message | ||
I personally link my css files using the root dir...
eg:
host/myaccount/mywebsite/mycssfile.css
That way, it's always pointing to the correct file...
hope it helps///
Danny Anderson <danderson@dfisystems.com>
30/12/2003 14:15
To
php-general@lists.php.net
cc
Subject
[PHP] best way to specify path to a file in a $variable?
Hola, PHP folk-
I am using
$page_title="some page title here";
require('header.inc');
to include a common header for all my pages. I am using $page_title so
I can have unique names for the different pages.
//---header.inc
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><?php echo $page_title; ?></title>
<link rel=stylesheet href="./some.css" type="text/css">
</head>
<body>
...
I want to be able to also define the path to the CSS file. For
instance, some pages will have the CSS in the same directory, so that
part would read
"./my.css"
If the page is located in a subdirectory, the path would then be
"../my.css"
I would like to use a php variable where I can define the path the same
way as the $page_title works. I have tried some experiments with a
$path_to_css variable, but I have not had much success. I think part of
the problem is that I might be stumbling over escaping everything
properly.
Is there a better way to do what I am trying to do?
Thanks,
Danny
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************