Skip navigation
This discussion is locked
Currently Being Moderated

Validation Output: 1 Error

Nov 14, 2012 4:07 AM

Hi

 

I have runned my html code against the W3C Code validator service  on HTML and XHTML. I got this one niggerling error. The explaination against the error is blinding.

 

What is character "<" is the first character of a delimiter but occured as data mean, what does it mean against the souce code

 

<form action="<?php echo $editFormAction;?> id="form1" name="form1" method ...

 

It is suggesting several cases this might be remedied.

 

You tried to include the "<" character om you page: you should escape it as "&lt"

 

You used an unescaped ampersand "&" this may be valid in some contexts but it is recommended to use "&amp", which is always safe

 

Another possibilty is that you forgot to close quotes in  previous flag.

 

I must say if the PHP souce document has no syntax error and to me it looks legitimate code what is the machine engine validator trying to say. Please advise. Thanks. I am myth by this.

 

The HTML is showing identical to the PHP. so if the PHP is valid code why should it throw up invalid error on coding?

 
Replies
  • Currently Being Moderated
    Nov 14, 2012 5:13 AM   in reply to Reynold Dreamweaver CS6

    <form action="<?php echo $editFormAction;?> id="form1" name="form1" method ...

     

    should be this -

     

    <form action="<?php echo $editFormAction;?>" id="form1" name="form1" method ...

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 14, 2012 5:40 AM   in reply to Reynold Dreamweaver CS6

    You have this -

     

    action="<?php echo $editFormAction;?>;" id="form1"

     

    It should be this -

     

    action="<?php echo $editFormAction;?>" id="form1"

     

    I don't see how that could trigger the error you are showing, but give it a try.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 14, 2012 6:04 AM   in reply to Reynold Dreamweaver CS6

    Change this -

     

    </div>

    </body>

    </html>

     

    to this -

     

    </div>

    </div>

    </body>

    </html>

     

    as has been suggested numerous times already.

     

    Then recognize that your page is named "Attendance.htm, yet it contains PHP scripting.  The validator is completely confused by this since the PHP is NOT BEING PARSED OUT BY THE SERVER, thus it's left in the code.  Rename your page to Attendance.php and validate it again.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 14, 2012 2:50 PM   in reply to Reynold Dreamweaver CS6

    Your page is named with an *.html extension.  The server will not parse this page to find, execute and remove the PHP, so you are sending your PHP to the HTML validator.  Naturally the validator things your PHP is an error.

     

    In DW edit the file in the Files panel to change its extension from *.html to *.php.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 14, 2012 2:54 PM   in reply to MurraySummers

    And you STILL have an unclosed <div>! 

     

    Change this -

     

    </script>

    </div>

    </div>

    </body>

     

    to this -

     

    </script>

    </div>

    </div>

    </div>

    </body>

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 14, 2012 3:41 PM   in reply to Reynold Dreamweaver CS6

    You need to do one more thing - change the file's extension to PHP. Upload it. Then validate again.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 15, 2012 5:05 AM   in reply to Reynold Dreamweaver CS6

    You must have a testing server defined to view pages containing PHP scripting locally.  This dialog is trying to tell you that.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 15, 2012 5:16 AM   in reply to Reynold Dreamweaver CS6

    You must have a testing server defined for any active scripting site. The location and the identity of this testing server depends on your setup. If you are working with PHP, your testing server MUST have Apache installed, and if you are working with MySQL, your testing server MUST have MySQL installed.  This server could be your local computer, or a shared network computer, or even the remote server for the production site.  The latter option is NOT generally a good choice, however, unless you are experienced with managing such configurations.

     

    My personal configuration is with two servers defined - the production server for the FTP remote site, and a local shared box (running Linux with Apache and MySQL) for the testing server.

     

    When I preview a PHP file, the file is uploaded to the testing server, and then SERVED from that location back to my local browser.  This allows my local PHP to be executed and the page built by the testing server before uploading it back to my local browser.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 15, 2012 5:42 AM   in reply to Reynold Dreamweaver CS6

    Your English is very difficult for me to follow.

     

    Using the remote server as your testing server is a bad plan, as I indicated earlier.  I think you need to have a local testing server for your development work.  That would require that you get and install WAMP on your laptop unless you also have a networked box that you could use.

     

    If the local site *and* the testing server are the same box, many people will place the local root folder in the Apache default folder.  In that case, there is no uploading of files between the local site and the testing server. The file being edited in DW, and the file being served by the testing server are the same file.  When the testing server is not the same as the local site, DW will have to upload each file being previewed from the local site to the testing server.

     

    But here's a clue for you.  ALL OF THESE CONCEPTS and operations are deeply discussed and painstakingly described in David Powers' Foundation PHP books.  I strongly encourage you to get his latest one and use that as your reference in preparing your local development environment.  To try to do this one concept at a time here on this forum is a burden for everyone.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 15, 2012 6:16 AM   in reply to Reynold Dreamweaver CS6

    I did not want to have a local server by choice as it compromises my laptop security.

     

    I don't think that is the case.

     

    So if I had the local server than these will not occur?

     

    There's no way to guarantee that.  Most (all?) of the 'errors' you are describing are operator errors. Having a local testing server is just a standard configuration for doing this kind of work.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 16, 2012 5:09 AM   in reply to Reynold Dreamweaver CS6

    Let's keep this discussion in the nearly duplicate thread you have posted.  I have replied over there.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points