OZONE Asylum
Forums
Server-Side Scripting - Oh my!
Direct link to stylesheets help please
This page's ID:
31071
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Im trying to link to my style sheets from the root of my drive so that i can put the same dynamic link on every page no matter where the page is located on my site this is my code: [code] define('STYLE_PATH', "C:\wamp\www\digiblueprint\public\stylesheets\main.css"); $page_title = "Testing Layout Function"; $stylesheet = "main.css"; public static function page_header($page_title="", $stylesheet="") { $style_path = STYLE_PATH; $output = "<html>\n"; $output .= "<head>\n"; $output .= "<title>". $page_title ."</title>\n"; $output .= "<link href=\"". $style_path ."\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\n"; $output .= "</head>\n"; $output .= "<body>\n"; $output .= "<div id=\"header\">\n"; $output .= "<h1>". $page_title ."</h1>\n"; $output .= "</div>\n"; $output .= "<div id=\"main\">\n"; echo $output; } [/code] but the linking to the style sheet only works when i use this kind of link [code] $output .= "<link href=\"". STYLE_PATH.DS.$stylesheet ."\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\n"; [/code] my test page looks like this [code] <?php require_once("includes/initialize.php"); ?> <?php $page_title = "Testing Layout Function"; $stylesheet = "main.css"; ?> <?php Layout::page_header($page_title, $stylesheet); ?> <?php echo "<div><p>This is a test page for layout.</p></div>"; ?> <?php Layout::page_footer(); ?> [/code] can someone please tell me what im missing or doing wrong [small](Edited by [url=http://www.ozoneasylum.com/user/3672]Hustluz[/url] on 06-21-2009 00:21)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail