PHP... HTML... does it really matter?
Posted: Fri Jun 13, 2008 12:14 am
I tried to look around the forum to find my answer but I don't know where to begin or even what it's called.
I have to save all my file in .php because if I save them in .html they don't work once I load them to my server. I'm sure all my external files have to be in php to work with the php command (I'm guessing) but If I put my index and other main pages with the .html extension the site crash. all I have left is the text with no style (css) whatsoever.
In php everything works great, the only thing is I have to use .php in the address bar at the
end instead of .html.
example: http://www.mydomain.com/page2.php instead of .html
I'm using a couple of external files for my navigation menu and my footer... In case it matters too.
Here's my files:
in my index.php file
<html>
<body>
<div id="navbar">
<?php include("navbar.php"); ?>
</div>
</body>
</html>
In my navbar.php file
<h2>MENU</h2>
<ul>
<li><a href>HOME</a></li>
<li><a href>Contact Us</a></li>
</ul>
also here's my DOCTYPE and <head> in my index file just in case.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/xml; charset=utf-8" />
<title>Untitled document</title>
<link rel = "stylesheet"
type = "text/css"
href = "stylesheet.css" />
</head>
I know that most people are used to see .html... I know when I'm surfing the net, I'm always putting .html at the end of the address and rarely .php, but does it really matter?
Thanks for your time,
Louis
I have to save all my file in .php because if I save them in .html they don't work once I load them to my server. I'm sure all my external files have to be in php to work with the php command (I'm guessing) but If I put my index and other main pages with the .html extension the site crash. all I have left is the text with no style (css) whatsoever.
In php everything works great, the only thing is I have to use .php in the address bar at the
end instead of .html.
example: http://www.mydomain.com/page2.php instead of .html
I'm using a couple of external files for my navigation menu and my footer... In case it matters too.
Here's my files:
in my index.php file
<html>
<body>
<div id="navbar">
<?php include("navbar.php"); ?>
</div>
</body>
</html>
In my navbar.php file
<h2>MENU</h2>
<ul>
<li><a href>HOME</a></li>
<li><a href>Contact Us</a></li>
</ul>
also here's my DOCTYPE and <head> in my index file just in case.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/xml; charset=utf-8" />
<title>Untitled document</title>
<link rel = "stylesheet"
type = "text/css"
href = "stylesheet.css" />
</head>
I know that most people are used to see .html... I know when I'm surfing the net, I'm always putting .html at the end of the address and rarely .php, but does it really matter?
Thanks for your time,
Louis