I am quite new to PHP.
I built a .php website which I've hooked up to a local test server using MAMP. For some reason, although I can view the site in my browser (Chrome), and the PHP works (I built a form that sends email), none of the CSS from the external style sheet I linked, nor the javascript from the external javascript file I linked is working.
If I type any of the CSS or script inline, everything works fine. I've used external files many times before in .html files and they have all worked just fine. What am I doing wrong here?
my .php file:
<?php
$to = 'email@email.com';
$subject = 'subject';
$message = $_POST['message'];
$message = <<<EMAIL
$message
EMAIL;
$header = '$email';
if($_POST){
mail($to, $subject, $message);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Php Test</title>
</head>
<link rel="stylesheet" type="text/css" href="PhpTest.css"/>
<body onload="alertFunction()">
<h1 id="header">Text text text.</h1>
<form action="?" method="post">
<ul>
<li>
<label for="message">Message:</label>
<textarea id="message" name="message" cols="42" rows="9"></textarea>
</li>
<li>
<input type="submit" value="Submit"</li>
</li>
</ul>
</form>
<footer>
<script type="text/javascript" src="PhpTest.js"></script>
</footer>
</body>
</html>
my css:
#header{
color:#3C9;
}
my javascript:
function alertFunction()
{
alert("Alert.");
}
Update: I started a new .php in Dreamweaver from scratch. I added no actual PHP code; I just placed a header within the body, linked to an external CSS within the head tag (within the CSS I simply designated the header's color as a blue) and tried that. As it turns out, Dreamweaver will recognize the link and apply the CSS it when I view the site using the design/split screen, however when I try to preview it in Chrome, it fails. I have no idea what this means, but if anyone has any theories they would be very much appreciated. Thanks.