Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question validating page: Stray end tag div.

    Please help, when trying to validate my page, I get the error:

    Code:
    Line 194, Column 7: Stray end tag div.
    
    	</div>
    here is relevant code:

    Code:
    <section id="slider" style="background-color: #ffffff;">
    		<div id="viewport">
    			<div id="container"> 
    				<div id="section-1" class="section section1">
    				    <p>Jewellery Boxes</p>
    				</div>
    				<div id="section-2" class="section section2">
    					<p>Moulded tags and Hangers</p>
    				</div>
    				<div id="section-3" class="section section3">
    				   	<p>Labels</p>
    				</div>
    				<div id="section-4" class="section section4">
    				    <p>Lipcards</p>
    				</div>
    				<div id="section-5" class="section section5">
    				    <p>Ancillaries</p>
    				</div>
    				<div id="section-6" class="section section6">
    				    <p>String Tags and Swing Tickets</p>
    				</div>
    				<div id="section-7" class="section section7">
    				    <p>Security Tags</p>
    				</div>
    				<div id="section-8" class="section section8">
    				    <p>Pillow Packs</p>
    				</div>
    				<div id="section-9" class="section section9">
    				    <p>Accessory Packaging</p>
    				</div>
    				<div id="section-10" class="section section10">
    				    <p>Hoisiery and Underwear Packaging</p>
    				</div>
    				<div id="section-11" class="section section11">
    				    <p>Jewellery Bags and Pouches</p>
    				</div>
    				<div id="section-12" class="section section12">
    				    <p>Jewellery Cards</p>
    				</div>
    			</div>
    		</div>
    		</section>
    link to site: http://www.aandheurope.com/index.php?PageID=1

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    here is relevant code:
    The problem might be somewhere else. Could you post a link or the complete code?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts
    here is all the code:

    Code:
    <?
    session_start();
    mysql_connect("xxxx", "xxxx", "xxxx");
    mysql_select_db("xxxx");
    include_once("paginate-products.php");
    if($_REQUEST['PageID'] == ""){
    	$PageID = '1';
    } else {
    	$PageID = $_REQUEST['PageID'];
    }
    
    if($_REQUEST['CategoryID'] == ""){
    	$CategoryID = '0';
    } else {
    	$CategoryID = $_REQUEST['CategoryID'];
    	
    
    $tableName="ah_products";		 	
    	$limit = 100; 
    	$targetpage = "index.php";
    	$query = "SELECT COUNT(*) as num FROM $tableName WHERE CategoryID=$CategoryID";
    	
    	$total_pages = mysql_fetch_array(mysql_query($query));
    	$total_pages = $total_pages['num'];
    
    	$stages = 3;
    	$page = mysql_escape_string($_REQUEST['pagec']);
    	if( isset($_REQUEST['pagec']) && ctype_digit($_REQUEST['pagec']) ) {
          $page = (int) $_GET['pagec'];
          $start = ($page - 1) * $limit;
    }else{
          $start = 0;   
    }
    
    // Initial page num setup
    	if ($page == 0){$page = 1;}
    	$prev = $page - 1;	
    	$next = $page + 1;							
    	$lastpage = ceil($total_pages/$limit);		
    	$LastPagem1 = $lastpage - 1;
    $paginateproducts = '';
    	if($lastpage > 1)
    	{	
    	
    	$paginateproducts .= "<div id='paginate'>";
    		$paginateproducts .= "<div class='pagination'>";
    		// Previous
    		if ($page > 1){
    			$paginateproducts.= "<a href='$targetpage?pagec=$prev&pageu=1&CategoryID=$CategoryID' title='Previous Page'>&laquo; Previous</a>";
    		}else{
    			$paginateproducts.= "<span class='disabled' title='Previous page'>&laquo; Previous</span>";	}
    			
    
    		
    		// Pages	
    		if ($lastpage < 7 + ($stages * 2))	// Not enough pages to breaking it up
    		{	
    			for ($counter = 1; $counter <= $lastpage; $counter++)
    			{
    				if ($counter == $page){
    					$paginateproducts.= "<a href='#' class='number current'>$counter</a>";
    				}else{
    					$paginateproducts.= "<a href='$targetpage?pagec=$counter&pageu=1&CategoryID=$CategoryID' class='number'>$counter</a>";}					
    			}
    		}
    		elseif($lastpage > 5 + ($stages * 2))	// Enough pages to hide a few?
    		{
    			// Beginning only hide later pages
    			if($page < 1 + ($stages * 2))		
    			{
    				for ($counter = 1; $counter < 4 + ($stages * 2); $counter++)
    				{
    					if ($counter == $page){
    						$paginateproducts.= "<a href='#' class='number current'>$counter</a>";
    					}else{
    						$paginateproducts.= "<a href='$targetpage?pagec=$counter&pageu=1&CategoryID=$CategoryID' class='number'>$counter</a>";}					
    				}
    				$paginateproducts.= "...";
    				$paginateproducts.= "<a href='$targetpage?pagec=$LastPagem1&pageu=1&CategoryID=$CategoryID' class='number'>$LastPagem1</a>";
    				$paginateproducts.= "<a href='$targetpage?pagec=$lastpage&pageu=1&CategoryID=$CategoryID' class='number'>$lastpage</a>";		
    			}
    			// Middle hide some front and some back
    			elseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2))
    			{
    				$paginateproducts.= "<a href='$targetpage?pagec=1&pageu=1&CategoryID=$CategoryID' class='number'>1</a>";
    				$paginateproducts.= "<a href='$targetpage?pagec=2&pageu=1&CategoryID=$CategoryID' class='number'>2</a>";
    				$paginateproducts.= "...";
    				for ($counter = $page - $stages; $counter <= $page + $stages; $counter++)
    				{
    					if ($counter == $page){
    						$paginateproducts.= "<span class='number current'>$counter</span>";
    					}else{
    						$paginateproducts.= "<a href='$targetpage?pagec=$counter&pageu=1&CategoryID=$CategoryID' class='number'>$counter</a>";}					
    				}
    				$paginateproducts.= "...";
    				$paginateproducts.= "<a href='$targetpage?pagec=$LastPagem1&pageu=1&CategoryID=$CategoryID' class='number'>$LastPagem1</a>";
    				$paginateproducts.= "<a href='$targetpage?pagec=$lastpage&pageu=1&CategoryID=$CategoryID' class='number'>$lastpage</a>";		
    			}
    			// End only hide early pages
    			else
    			{
    				$paginateproducts.= "<a href='$targetpage?pagec=1&pageu=1&CategoryID=$CategoryID' class='number'>1</a>";
    				$paginateproducts.= "<a href='$targetpage?pagec=2&pageu=1&CategoryID=$CategoryID' class='number'>2</a>";
    				$paginateproducts.= "...";
    				for ($counter = $lastpage - (2 + ($stages * 2)); $counter <= $lastpage; $counter++)
    				{
    					if ($counter == $page){
    						$paginateproducts.= "<a href='#' class='number current'>$counter</a>";
    					}else{
    						$paginateproducts.= "<a href='$targetpage?pagec=$counter&pageu=1&CategoryID=$CategoryID' class='number'>$counter</a>";}					
    				}
    			}
    		}
    					
    				// Next
    		if ($page < $counter - 1){ 
    			$paginateproducts.= "<a href='$targetpage?pagec=$next&pageu=1&CategoryID=$CategoryID' title='Next Page'>Next Page &raquo;</a>";
    		}else{
    			$paginateproducts.= "<span class='disabled' title='Next Page'>Next Page &raquo;</span>";
    			}
    			
    		$paginateproducts.= "</div>";
    		$paginateproducts.= "</div>";
    	}
    	
    	
    	
    	
    	
    	$result = mysql_query("SELECT * FROM ah_categories WHERE CategoryID = ".$CategoryID);
    	$Cat = $result && mysql_num_rows($result) == 1 ? mysql_fetch_assoc($result) : false; 
    	
    	$query4 = "SELECT * FROM ah_products INNER JOIN ah_productpics ON ah_products.ProductID=ah_productpics.ProductID WHERE CategoryID ='$CategoryID' LIMIT $start, $limit";
    	$result4 = mysql_query($query4);  	
    	
    }
    
    if($_REQUEST['ProductID'] == ""){
    	$ProductID = '0';
    } else {
    	$ProductID = $_REQUEST['ProductID'];
    	
    	$result5 = mysql_query("SELECT * FROM ah_products WHERE ProductID ='$ProductID'");
    	$Prod = $result5 && mysql_num_rows($result5) == 1 ? mysql_fetch_assoc($result5) : false; 
    	
    	$querypics = "SELECT * FROM ah_productpics WHERE ProductID = $ProductID";
    	$resultpics = mysql_query($querypics); 	
    	
    }
    
    $qry="SELECT PageID,PageTitle,PageText,PageKeywords,PageDescription FROM ah_pages WHERE PageID = '$PageID'";
    $cur=mysql_query($qry);
    while($i=mysql_fetch_row($cur))
    {$PageID=$i[0];
    $PageTitle1=$i[1];
    $PageText1=$i[2];
    $PageKeywords1=$i[3];
    $PageDescription1=$i[4];
    }
    
    $query1 = "SELECT * FROM ah_pages";
    $result1 = mysql_query($query1);
    
    $subquery1 = "SELECT * FROM ah_pages";
    $subresult1 = mysql_query($subquery1);
    
    $query2 = "SELECT * FROM ah_categories";
    $result2 = mysql_query($query2);
    
    $query3 = "SELECT * FROM ah_categories";
    $result3 = mysql_query($query3);
    
    $subquery3 = "SELECT * FROM ah_categories";
    $subresult3 = mysql_query($subquery3);
    
    ?>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<title><?php echo $PageTitle1;?></title>
    	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    	<meta name="keywords" content="<?php echo $PageKeywords1; ?>" />
    	<meta name="description" content="<?php echo $PageDescription1; ?>" />
    	<meta name="robots" content="index,follow,archive" />
    	<link rel="stylesheet" type="text/css" href="css/reset.css" />
    	<link rel="stylesheet" type="text/css" href="css/style.css" />
    	<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
    	
    	
    	
    	<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
    	<script type="text/javascript" src="js/jquery-ui-1.8.7.custom.min.js"></script>
    
    	<script type="text/javascript" src="js/prototype.js"></script>
    
    	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    	<script type="text/javascript" src="js/ddsmoothmenu.js"></script>
    		<script type="text/javascript" src="js/jquery.scrollTo.js"></script>
    	
    	<script type="text/javascript">
    	
    	ddsmoothmenu.init({
    		mainmenuid: "smoothmenu1", //menu DIV id
    		orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
    		classname: 'ddsmoothmenu', //class added to menu's outer DIV
    		//customtheme: ["#1c5a80", "#18374a"],
    		contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    	})
    	
    	</script>
    	<script type="text/javascript">
     
            var sections = [
                "section-1", 
                "section-2",
                "section-3",
                "section-4",
                "section-5",
    			"section-6",
    			"section-7",
    			"section-8",
    			"section-9",
    			"section-10",
    			"section-11",
    			"section-12"
            ];
           
    		var currentSection = 1;
    		
            function scroll () {
              
    		    currentSection++;
    			if(currentSection > 12){currentSection = 1;}
    			if(currentSection == 1){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 2){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 3){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 4){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 5){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 6){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 7){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 8){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 9){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 10){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 11){$("#slider").animate({backgroundColor: '#ffffff'});}
    			if(currentSection == 12){$("#slider").animate({backgroundColor: '#ffffff'});}
    			sectiontoscroll = "section-" + currentSection;
                $("#viewport").scrollTo ("#" + sectiontoscroll, 1000);
    			
            }
    
            $(document).ready (function () {
    				var s = window.setInterval(scroll, 4000);
    				//window.clearInterval(s);
            });
        </script>
        <script type="text/javascript">
    	    function slideSwitch() {
    	    var $active = $('#aboutslider IMG.active');
    	
    	    if ( $active.length == 0 ) $active = $('#aboutslider IMG:last');
    	
    	    var $next =  $active.next().length ? $active.next()
    	        : $('#aboutslider IMG:first');
    	
    	    $active.addClass('last-active');
    	
    	    $next.css({opacity: 0.0})
    	        .addClass('active')
    	        .animate({opacity: 1.0}, 1000, function() {
    	            $active.removeClass('active last-active');
    	        });
    	}
    	
    	$(function() {
    	    setInterval( "slideSwitch()", 5000 );
    	});
        </script>
       <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAM17e4xGXwO4sBd_QYtRiSRTT016U4M-8uqcAfGlN5wKAuJrQ7RR_et7vjmQ96zUFS7mCZFE6WWbCdg" type="text/javascript"></script>
       <script type="text/javascript">
    
        function initialize() {
          if (GBrowserIsCompatible()) {
            var map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng(50.9576846418103, -0.30470027208815), 15);
            map.setUIToDefault();
          }
        }
    
        </script>
    
        <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    	<script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-28646788-1']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    
    </script>
    </head>
    <body onload="initialize()" onunload="GUnload()">
    	<div id="header">
    		<div id="top">
    			<h1>A&amp;H Display Cards Europe</h1>
    			<div class="logo">
    				<a href="index.php" title="A and H Europe Logo"><img src="images/aandhlogo.jpg" alt="A and H Europe Logo" /></a>
    			</div>
    			<div class="springfair"></div>
    			<div id="menu">
    				<div id="smoothmenu1" class="ddsmoothmenu">
    					<ul> 
    						<?php
    						while($row1 = mysql_fetch_array($result1))
    						{
    						echo '<li><a href="index.php?PageID='.$row1['PageID'].'" title="'.$row1['PageName'].'" '; if($row1['PageID'] == $PageID){ echo 'class="selected"'; } echo ' >'.$row1['PageName'].'</a>';
    						if($row1['PageID'] == '3'){
    							echo '<ul>';
    							while($row2 = mysql_fetch_array($result2))
    						{
    						echo '<li><a href="index.php?PageID='.$row1['PageID'].'&amp;CategoryID='.$row2['CategoryID'].'" title="'.$row2['CategoryName'].'" ';if($row1['PageID'] == $PageID){ echo 'class="selected"'; } echo ' >'.$row2['CategoryName'].'</a></li>';	
    						}
    						echo '</ul></li>';
    						}
    						}
    						?>
    					</ul>
    				</div>
    			</div>
    		</div>
    	</div>
    	<div id="content">
    		<?php if($CategoryID == '0') {?>
    		<?php if($PageID == '2') {?>
    		<section id="slider" style="background-color: #ffffff;">
    		<div id="aboutslider">
    			<img src="images/slider_07.png" alt="A&H Erope and USA" class="active" />
    		    <img src="images/slider_08.png" alt="A&H China" />
    		</div>
    		</section>
    		<?php } else { ?>
    		<section id="slider" style="background-color: #ffffff;">
    		<div id="viewport">
    			<div id="container"> 
    				<div id="section-1" class="section section1">
    				    <p>Jewellery Boxes</p>
    				</div>
    				<div id="section-2" class="section section2">
    					<p>Moulded tags and Hangers</p>
    				</div>
    				<div id="section-3" class="section section3">
    				   	<p>Labels</p>
    				</div>
    				<div id="section-4" class="section section4">
    				    <p>Lipcards</p>
    				</div>
    				<div id="section-5" class="section section5">
    				    <p>Ancillaries</p>
    				</div>
    				<div id="section-6" class="section section6">
    				    <p>String Tags and Swing Tickets</p>
    				</div>
    				<div id="section-7" class="section section7">
    				    <p>Security Tags</p>
    				</div>
    				<div id="section-8" class="section section8">
    				    <p>Pillow Packs</p>
    				</div>
    				<div id="section-9" class="section section9">
    				    <p>Accessory Packaging</p>
    				</div>
    				<div id="section-10" class="section section10">
    				    <p>Hoisiery and Underwear Packaging</p>
    				</div>
    				<div id="section-11" class="section section11">
    				    <p>Jewellery Bags and Pouches</p>
    				</div>
    				<div id="section-12" class="section section12">
    				    <p>Jewellery Cards</p>
    				</div>
    			</div>
    		</div>
    		</section>
    		<?php }?>
    		<?php echo $PageText1;?>
    		<?php if($PageID == '3'){?>
    			<div id="categories">
    			<?php
    			while($row3 = mysql_fetch_array($result3))
    						{
    						echo '<a href="index.php?PageID=3&amp;CategoryID='.$row3['CategoryID'].'" title="'.$row3['CategoryName'].'"><img src="category-images/'.$row3['CategoryPic'].'" height="150" alt="'.$row3['$CategoryName'].'" /><h4>'.$row3['CategoryName'].'</h4></a>';	
    						}
    			?>
    			</div>
    		<?php } ?>
    		<?php } else {?>
    		<div id="viewport">
    			<div id="container">
    				<img src="category-images/<?php echo $Cat['CategoryTopPic']; ?>" alt="<?php echo $Cat['CategoryName']; ?>" />
    			</div> 
    		</div>
    		<?php if($ProductID != '0'){?>	
    		<?php echo '<div id="breadcrumbs"><a href="index.php" title="A and H Europe">HOME</a> > <a href="index.php?PageID=3" title="A and H Europe Products">Products</a> > <a href="index.php?CategoryID='.$CategoryID.'" title="'.$Cat['CategoryName'].'">'.$Cat['CategoryName'].'</a> > '.$Prod['ProductName'].'</div>';?>		
    		<div id="product">
    				<?php 
    				echo '<h2>'.$Prod['ProductName'].'</h2>';
    				echo '<p>'.$Prod['ProductDesc'].'</p>';
    				while($row5 = mysql_fetch_array($resultpics))
    					{
    				echo '<img src="product-images/'.$row5['PicturePath'].'" alt="'.$row5['PictureName'].'" width="950" /';
    					}
    				?>		
    		</div>
    
    		<?php } else {?>
    		<?php echo '<div id="breadcrumbs"><a href="index.php" title="A and H Europe">HOME</a> > <a href="index.php?PageID=3" title="A and H Europe Products">Products</a> > '.$Cat['CategoryName'].'</div>';?>
    		<p><?php echo $Cat['CategoryDesc'] ?></p>
    		<div id="products">
    		<?php
    		
    		while($row4 = mysql_fetch_array($result4))
    					{
    					echo '<a href="index.php?PageID=3&amp;CategoryID='.$CategoryID.'&amp;ProductID='.$row4['ProductID'].'" title="'.$row4['ProductName'].'"><img src="product-thumbs/'.$row4['PicturePath'].'" alt="'.$row4['$ProductName'].'" /><h4>'.$row4['ProductName'].'</h4></a>';	
    					}
    					?>
    		</div>
    		<!-- .pagination -->
    			<?php //echo $paginateproducts;?>
    		<!-- End .pagination -->
    		<?php }}?>
    		</div>
    	</div>
    	<div id="subfooterwrap">
    		<div id="subfooter">
    			<div class="col1">
    				<ul>
    					<?php
    						while($subrow1 = mysql_fetch_array($subresult1))
    						{
    						echo '<li><a href="index.php?PageID='.$subrow1['PageID'].'" title="'.$subrow1['PageName'].'">'.$subrow1['PageName'].'</a></li>';
    						}
    					?>
    				</ul>
    			</div>
    			<div class="col2">
    				<ul>
    					<?php
    				while($subrow3 = mysql_fetch_array($subresult3))
    					{
    					echo '<li><a href="index.php?PageID=2&amp;CategoryID='.$subrow3['CategoryID'].'" title="'.$subrow3['CategoryName'].'">'.$subrow3['CategoryName'].'</a></li>';	
    					}
    				?>
    				</ul>
    			</div>
    			<div class="col3">
    				<h2>Contact Us</h2>
    				<p>24b Star Road<br />
    				Partridge Green<br />
    				West Sussex<br />
    				RH13 8RA<br />
    				United Kingdom</p>
    				<p>t: +44(0) 1403 710055<br />
    				f: +44(0) 1403 711082<br />
    				e: <a href="mailto:sales@aandheurope.com" title="Email A and H Europe">sales@aandheurope.com</a><br /><br />
    				Head Office: <a href="http://www.aandhusa.com" title="US Head Office">www.aandhusa.com</a>
    				</p>
    			</div>
    			<div class="col4">
    				<img src="images/logo_small.png" alt="A and H Europe logo" />
    			</div>
    		</div>
    	</div>
    	<footer>
    		<span>Site Design by: <a href="http://www.jbiddulph.com" target="_blank" title="John Biddulph - Web Development">jbiddulph.com</a></span>Copyright &copy; 2012 A&amp;H Europe
    	</footer>
    </body>
    </html>

  • #4
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,927
    Thanks
    46
    Thanked 203 Times in 202 Posts
    you have 35 <div occurences and 36 </div within your <body> tag-set... meaning you literally have an extra </div> tag somewhere in your code
    I assume @
    Line 194, Column 7: Stray end tag div.
    I would go though and save off a copy and start ripping out all extra content until you have just <div>'s left and see where the extra </div> should be removed from

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    here is all the code:
    Sorry, this is HTML & CSS forum, so you need to post the parsed HTML output taken from your browser's view source option. The validator is also talking about the line number in the HTML source of your page.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •