RE: html tags not matching
Tim,
I will work with check_html script first. Then I am planning to install W3C Validator on my server to verify the result.
Phil,
It is both. The problem of the script that it does not know how to evaluate if-else correctly. The problem with the code is that it is confusing and prone to errors. You can easily miss that some set of conditions do not create some tags at all. Here to illustrate my point some code from AccountSections.php. What happens when DB_num_rows($result) == 0 ?
if (isset($_GET['SelectedSectionID'])) {
//editing an existing section
$sql = "SELECT sectionid,
sectionname
FROM accountsection
WHERE sectionid='" . $_GET['SelectedSectionID'] ."'";
$result = DB_query($sql, $db);
if ( DB_num_rows($result) == 0 ) {
prnMsg( _('Could not retrieve the requested section please try again.'),'warn');
unset($_GET['SelectedSectionID']);
} else {
$myrow = DB_fetch_array($result);
$_POST['SectionID'] = $myrow['sectionid'];
$_POST['SectionName'] = $myrow['sectionname'];
echo '<input type=hidden name="SelectedSectionID" value="' . $_POST['SectionID'] . '" />';
echo '<table class="selection">
<tr>
<td>' . _('Section Number') . ':' . '</td>
<td>' . $_POST['SectionID'] . '</td>
</tr>';
}
} else {
if (!isset($_POST['SelectedSectionID'])){
$_POST['SelectedSectionID']='';
}
if (!isset($_POST['SectionID'])){
$_POST['SectionID']='';
}
if (!isset($_POST['SectionName'])) {
$_POST['SectionName']='';
}
echo '<table class="selection">
<tr>
<td>' . _('Section Number') . ':' . '</td>
<td><input tabindex="1" ' . (in_array('SectionID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SectionID" class="number" size="4" maxlength="4" value="' . $_POST['SectionID'] . '" /></td>
</tr>';
}
echo '<tr><td>' . _('Section Description') . ':' . '</td>
<td><input tabindex="2" ' . (in_array('SectionName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SectionName" size="30" maxlength="30" value="' . $_POST['SectionName'] . '" /></td>
</tr>';
echo '<tr><td colspan="2"><div class="centre"><input tabindex="3" type="submit" name="submit" value="' . _('Enter Information') . '" /></div></td></tr>';
echo '</table><br />';
|