Jump to content
Larry Ullman's Book Forums

Recommended Posts

app dir

         css
     		style.css

         inc
     		header.inc.php
         	footer.inc.php

 index.php
 login.php
 register.php

 

style.css is included in the header.inc.php

<?php
//Include a error reporting:
include '../../errorReport.inc.php';
// Set default timezone:
define('TZ', date_default_timezone_set('America/Los_Angeles') );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
   <title>
   <?php
   if(defined('TITLE'))
   {
       print TITLE;
   } else {
       print 'Raise High the Roof Beam! A J.D. Salinger Fan Club';
   }

   ?>
   </title>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <link rel="stylesheet" href="./c/screen.css" media="screen,projection" />
</head>

 

Upon creating a new page(login.php) the goal is adding styles to the include(d) CSS, the following is my attempt, it has failed:

<?php
header('content-type:text/css', replace);
header("Expires: ".gmdate("D, d M Y H:i:s", (time()+900)) . " GMT");
$errorColor = '#900';
echo '.error{ color: '.$errorColor.'; }';
?>

<?php include 'inc/header.inc.php';?>


<p class=\"error\">Error MSG</p>

<?php include 'inc/footer.inc.php';?>

 

This is printed to the UA:

.error{ color: #900; }<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>	<title>	Raise High the Roof Beam! A J.D. Salinger Fan Club	</title>	<meta http-equiv="content-type" content="text/html; charset=utf-8" />	<link rel="stylesheet" href="./c/screen.css" media="screen,projection" /></head><body><div id="wrapper">.................................

Link to comment
Share on other sites

 Share

×
×
  • Create New...