I have a PHP file that fails validation.
The W3C validator claims that there are three divs missing their closing tag,
or that perhaps there is something in the divs that the validator doesn't like.
I suspect the later as I did a "view source" and copied the code (minus the PHP
code, in this case) to a new file, saved it as html and ran it through the
validator and it passed.
Here's the code (minus a few meta tags to make it shorter) - maybe another set
of eyes...:
<?php
error_reporting(0);
date_default_timezone_set ("America/New_York");
require ('../admin/handlers/db_connect.php');
mysql_query("SET NAMES 'UTF8'");
include('../admin/handlers/website_functions.php');
$title = '';
if (isset($_GET['id'])) {
$subtitle = '';
if (get_content('custom_products','subtitle',$_GET['id']) != '') { $subtitle =
': '.get_content('custom_products','subtitle',$_GET['id']); }
$title = get_content('custom_products','title',$_GET['id']).$subtitle.' -
'.get_content('custom_authors','fname',get_content('custom_products','author_id',$_GET['id'])).'
'.get_content('custom_authors','lname',get_content('custom_products','author_id',$_GET['id']));
if
(get_content('custom_authors','suffix',get_content('custom_products','author_id',$_GET['id']))
!= '') { $title .= ',
'.get_content('custom_authors','suffix',get_content('custom_products','author_id',$_GET['id']));
}
}
$description = 'Cedar Tree Books is a Wilmington, Delaware publisher of
non-fiction, local history books. Cedar Tree Books also assists authors in
self-publishing, as well as, commissions works by local historians and solicits
manuscripts from Wilmington area writers.';
if (isset($_GET['id']) &&
get_content('custom_products','meta_description',$_GET['id']) != '') {
$description = get_content('custom_products','meta_description',$_GET['id']); }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo strip_tags($title); ?></title>
<meta http-equiv="content-language" content="en-us">
<meta name="Description" content="<?php echo strip_tags($description) ?>">
<meta name="Keywords" content="<?php echo strip_tags(strtolower(str_replace(' -
',' ',$title))); ?> ">
<link href="../as/cs/pop_cat.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<div class="pop_box_top"><!--IE Hack--></div>
<div class="pop_box_con">
<div class="pop_con">
<?php
$search_product = mysql_query("SELECT * FROM custom_products WHERE id =
'".$_GET['id']."'");
$verify_product = mysql_num_rows($search_product);
if (!isset($_GET['id']) || $verify_product == 0) { header('Location:
../index.php'); exit(); } else {
$result_product = mysql_fetch_array($search_product);
$edit_type = 'by';
if ($result_product['product_type'] == 1) { $edit_type = 'edited by'; }
if ($result_product['author_id'] == 0) { $edit_type = ''; }
$isbn = '';
if ($result_product['isbn_no'] != '') { $isbn = '<br>ISBN
'.$result_product['isbn_no']; }
$author = '';
if ($result_product['author_id'] != 0) {
$author = get_content('custom_authors','fname',$result_product['author_id']).'
'.get_content('custom_authors','lname',$result_product['author_id']);
if (get_content('custom_authors','suffix',$result_product['author_id']) != '')
{ $author .= ',
'.get_content('custom_authors','suffix',$result_product['author_id']); }
}
if ($result_product['coauthor_id'] != 0) {
$author .= ' and
'.get_content('custom_authors','fname',$result_product['coauthor_id']).'
'.get_content('custom_authors','lname',$result_product['coauthor_id']);
if (get_content('custom_authors','suffix',$result_product['coauthor_id']) !=
'') { $author .= ',
'.get_content('custom_authors','suffix',$result_product['coauthor_id']); }
}
$subtitle = '';
if ($result_product['subtitle'] != '') { $subtitle =
':<br>'.$result_product['subtitle']; }
$title = $result_product['title'].$subtitle;
echo '
<h1>'.$title.'</h1>
<h2><em>'.$edit_type.' '.$author.'</em></h2>
<div class="rule"></div>
<div class="fr"><img class="bord"
src="../as/im/'.get_content('custom_categories','normal_url',$result_product['category_id']).$result_product['photo'].'_lrg.jpg"
alt="'.strip_tags($result_product['title']).'" ></div>
'.$result_product['content'].'
<p><em>'.$result_product['description'].'
'.$isbn.'</em></p>
';
}
?>
<div class="clearit"></div>
</div>
</div>
<div class="pop_box_bot"><!--IE Hack--></div>
</div>
<?php include ("analyticsTracking.php"); ?>
</body>
</html>
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [email protected]
*******************************************************************