I'm working on my first website using php. I came up with a good way, or so I thought, to deal with including the css sheet depending on where I am. For example, I have a form that I submit to with this code:
$root = '../';
function died($error)
{
include '../includes/header.php';
echo "We are very sorry, but there were error(s) found with the form your submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
include '../includes/footer.php';
die();
}
I set the variable $root to have "../" and then here is the relevant part of header.php:
<link href="<?php echo $root;?>styles/styles.css" rel="stylesheet" type="text/css" />
I would think that it would put in "../" in front of styles, but it doesn't put anything. Why doesn't this work?
Thanks!