A few things to fix to make osCommerce Validate
Some are mistakes that should be fixed in osCommerce and some are just nitpicky things
BODY TAG
--------------------
The Body tag in osCommerce is redundant since the CSS file does this already
Not needed
CODE
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
Should be <body> only
And add this to the BODY in the CSS
CODE
padding : 0;
DOCTYPE
------------------
It isn't really hurting anything but should be in the correct case anyway
All files with
CODE
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
Should be
CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
IMAGE BORDER
-------------------
Image border="0" can't be used
Wrong --> <img src="images/thisimage.gif" border="0" alt="">
Has to be in the css file
CODE
img
{
border: 0;
}
{
border: 0;
}
Location to change it:
includes/functions/htmloutput.php
2 places to take out border="0"
LET OTHERS SEE YOU VALIDATE
Adding HTML and CSS validation images to the site(if you want that sort of thing)
Adding the HTML validation link is simple because W3C offers referrer code.
The CSS link for W3C takes a little more help though.
Adding the CSS validation link to your site:
Add to /includes/functions/html_output.php file just before the last ?>
CODE
// Get current page url for W3C validation
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
Then add this to the /includes/footer.php for the CSS Validation link
CODE
<?php echo '<a href="http://jigsaw.w3.org/css-validator/validator?uri=' . curPageURL() . '"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>'; ?>
If you have anything else then feel free to add your thoughts. I'm sure this has been talked about before at sometime.
Good luck in all you do,
Google Junky

