#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    112
    Rep Power
    11

    W3c check for stricked


    Hi I am going through web pages validating as strict.dtd

    w3c validator thinks I am closing an un-opened div. I have 2 opened
    <div id=thebody> & <div id="PageContent">

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Street Angel Home</title>
    <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <META http-equiv="imagetoolbar" CONTENT="no">
    <LINK rel="stylesheet" href="stylesheets/SM3S.css" type="text/css">
    </head>
    
    <body>
    <div id=thebody>
    <div id="PageTitle"></div>
    div id=margin></div>
    	<div id="PageContent">
        <h2>Login</h2>
        <form action="LogMe.php" method="post">
        
        <div><br>&nbsp;Company Key:<span style="color:blue;font-size:12px">&nbsp;(Supplied by your administrator NOT REQUIRED)</span></div>
        <div><input type="password" name="PWD2" size="25" maxlength="12" value="Billie Jean" readonly>&nbsp;<span style="color:red"><?echo $_SESSION["Error_2"]?></span></div>
           
        <div><br><br>&nbsp;User name:<br></div>
        <div><input type="text" name="Name" size="25" maxlength="20" value="">&nbsp;<span style="color:red"><?echo $_SESSION["Error_1"]?></span></div>
        
        <div><br><br>&nbsp;User Key:<br></div>
        <div><input type="password" name="PWD1" size="50" maxlength="35" value="">&nbsp;<span style="color:red"><?echo $_SESSION["Error_3"]?></span></div>
        <div style="height:20px">&nbsp;</div>
        
        <div><a href="iforgot.php">Forgot User key</a><br><br></div>
        <div><input type="submit" value="Login" name=submit1></div>
    	</form>
    </div>
    </div>
    </body>
    </html>
    Error:

    Line 32, Column 6: end tag for element "DIV" which is not open

    Can't see this one.

    TIA

    Desmond.
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,915
    Rep Power
    1045
    Hi,

    the W3C validator doesn't parse PHP, so remove your PHP stuff before you validate templates.

    You're missing a "<" in this line:
    Code:
    div id=margin></div>
    And you should really, really start indenting your markup properly. No offense, but this is tag soup. No wonder you get an error when you probably cannot follow the structure yourself.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers? There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo