Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't trace validation error 4

Status
Not open for further replies.

electronicmonkey

Technical User
Feb 19, 2007
45
GB
I am trying to validate my site after doing some alteration. I get two errors which I am unable to locate quickly enough. Can someone help me out ?
Site URL :
 
sorry I did not include the site html . Here it is.


<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// needed to seperate the ISO number from the language file constant _ISO
$iso = split( '=', _ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<?php mosShowHead(); ?>
<?php
if ( $my->id ) {
initEditor();
}
$collspan_offset = ( mosCountModules( 'right' ) + mosCountModules( 'user2' ) ) ? 2 : 1;
//script to determine which div setup for layout to use based on module configuration
$user1 = 0;
$user2 = 0;
$colspan = 0;
$right = 0;
// banner combos

//user1 combos
if ( mosCountModules( 'user1' ) + mosCountModules( 'user2' ) == 2) {
$user1 = 2;
$user2 = 2;
$colspan = 3;
} elseif ( mosCountModules( 'user1' ) == 1 ) {
$user1 = 1;
$colspan = 1;
} elseif ( mosCountModules( 'user2' ) == 1 ) {
$user2 = 1;
$colspan = 1;
}

//right based combos
if ( mosCountModules( 'right' ) and ( empty( $_REQUEST['task'] ) || $_REQUEST['task'] != 'edit' ) ) {
$right = 1;
}
?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $cur_template; ?>/css/template_css.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="<?php echo $mosConfig_live_site;?>/images/favicon.ico"/>
</head>
<body>

<div align="center" >
<div id="main_outer">
<div id="main_inner">
<div id="pathway_outer">
<div id="pathway_inner">
<div id="pathway_text">
<?php mosPathWay(); ?>
</div>
<div id="buttons">
<?php mosLoadModules ( 'user3', -1); ?>
</div>
</div>
</div>

<div id="search_outer">
<div id="search_inner">
<?php mosLoadModules ( 'user4', -1 ); ?>
</div>
</div>
<div class="clr"></div>
<div id="header_outer">
<div id="header">

<img style="width: 635px; height: 150px;" alt="banner"
title=" src="

</div>
<div id="top_outer">
<div id="top_inner">
<?php
if ( mosCountModules( 'top' ) ) {
mosLoadModules ( 'top' );
} else {
?>
<span class="error"></span>
<?php
}
?>
</div>
</div>
</div>
<div id="left_outer">
<div id="left_inner">
<?php mosLoadModules ( 'left' ); ?>
</div>
</div>
<div id="content_outer">
<div id="content_inner">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="content_table_outer">
<tr valign="top">
<td>
<?php
if ( mosCountModules ('banner') ) {
?>
<div class="banner_inner">
<?php mosLoadModules( 'banner', -1 ); ?>
</div>
<?php
}
?>

<table border="0" cellpadding="0" cellspacing="0" width="100%" class="content_table_inner">
<?php
if ($colspan > 0) {
?>
<tr>
<td width="100%" colspan="<?php echo $colspan; ?>">
<table class="user_mods" border="0" cellpadding="0" cellspacing="0" width="100%">
<?php
if ($colspan > 0) {
?>
<tr>
<?php
if ( $user1 > 0 ) {
?>
<td class="user1_outer">
<div class="user1_inner">
<?php mosLoadModules ( 'user1' ); ?>
</div>
</td>
<?php
}
if ( $colspan == 3) {
?>
<td width="2">
<img src="<?php echo $mosConfig_live_site;?>/templates/<?php echo $cur_template; ?>/images/spacer.png" alt="" title="spacer" border="0" height="10" width="2"/>
</td>
<?php
}
if ( $user2 > 0 ) {
?>
<td class="user2_outer">
<div class="user2_inner">
<?php mosLoadModules ( 'user2' ); ?>
</div>
</td>
<?php
}
?>
</tr>
<?php
}
?>
</table>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan="<?php echo $colspan; ?>" class="body_outer">
<?php mosMainBody(); ?>
</td>
</tr>
</table>
</td>
<?php
if ( $right > 0 ) {
?>
<td>
<div id="right_outer">
<div id="right_inner">
<?php mosLoadModules ( 'right' ); ?>
</div>
</div>
</td>
<?php
}
?>
</tr>
</table>
</div>
</div>
<div class="clr"></div>
</div>
</div>
</div>

</body>
</html>
 
Thanks for your help, ca8msm (Programmer). I also know how to use this validator. I was hoping to find assistance to pinpoint the source of those two errors , and that is why I have pasted the html above. Best wishes

 
Thanks;
In this case it certainly doesn't... and that is why I have posted the html. Can you locate the errors from this ? Thanks

 
Click on View Source of your page, go the the line number that the validator says the error is on and you'll see the element which has the error. Once you've found that you'll be able to look at your PHP code and see where that HTML is produced. You can do this easily by yourself and it will be just as quick for you to do this as it will for anybody else.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Thanks for your advice. Can you give that suggestion a shot and tell me how it works for you ? Considering the nature of my job, I wouldn't have posted this on a public forum of this type if the solution was so obvious. Thanks.

 
Ok dear, let's take your hand and go through this together. Your first error says:
validator said:
Error Line 77, column 21: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag .
So, on line 77 of your page you have a div object that is not supposed to be there. Let's look at the line 77 (mind you, you can just choose the option of show source in the validator.
Code:
<div align="center">
Ok, div on line 77, so far so good. And that div should not be there. Ok, let's find out why. Validator is helpful again.
validator said:
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>" or "<div>") inside an inline element (such as "<a>", "<span>", or "<font>").
Bolded parts present the solution. Ok, one error down.
validator said:
Error Line 82, column 11: end tag for "a" omitted, but OMITTAG NO was specified .
Oooh, I can see how this one will be more difficult. So, you have no end tag for an anchor, which should be ending at the line 82. Let's see line 82:
Code:
</td>
Ok, before this tag you should close the anchor. But where did anchor begin?!?!
validator said:
Info Line 76, column 4: start tag was here .
Oh look, validator helps. Gosh, I am really glad I am an experienced html programmer or else I would not know how to read. So, line 76 reads:
Code:
<a href="[URL unfurl="true"]http://www.websesame.co.uk"[/URL] target="_self">
Oh look. There is an anchor there. And furthermore, it has no closing tag. Oops. So, I guess we should either close it or delete it. Ok?

I really do not know why you needed me to read the validation page with you, but let me tell you that it was a pleasure. I just hope I could do it every day.
 
Problem is the string is not visible in the html of my script , but I'll locate it...sooner or later.

 
>>>Considering the nature of my job, I wouldn't have posted this on a public forum of this type if the solution was so obvious.

What, if I may ask, is the nature of your job? I ask because I wonder if you had this task dropped in your lap by surprise.

Also, I point you to this link, below Vragabond's post:

Thank Vragabond
for this valuable post!

If you click this, it will mark his post as helpful, which he very much deserves for taking the time to read through your source code and your validation results.

Just a thought,

Alex

Ignorance of certain subjects is a great part of wisdom
 
All I can say is wow....

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
uncle_rico_thumb.jpg
 
Wow, what a lively forum . Everyone just dying to throw in their own tuppence and to get cited (?) !!
Alexcuse, I did indeed thank Vragabond for his attempt to help.If you didn't see it because it was not in public, then blame the forum creator, not me.
I have also sent a thank-you for your comment; and also sent one to khat and ca8msm.You have been great.
Peace.

 
electronicmonkey - I did not want a star, nor do I deserve one. But, I am glad that you took the time to acknowledge Vragabond. I dabble in web stuff a little bit, and it is painful for me to try to make sense of those validator results (probably mostly because my coding is so poor ;-) )

cheers.gif


Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top