Results 1 to 7 of 7
Thread: html + php
Mar 26, 2009, 08:36 #1
html + php
I have a website that has html and php code. I tried to valid it but I have errors about every < where the php starts. I use DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" and someone told me that strict is not good.
Can someone please tell me why I have those errors after validation?
Mar 26, 2009, 08:42 #2
You must not validate the PHP script, but the HTML page that is a result after the PHP has been executed.
If you validated the HTML page, then the validation errors have nothing to do with the PHP begin and end tags. The real reason for those errors might be anything. To give you an answer, you should provide the errors and the html code, or a link to the page that is giving you problems.
Mar 26, 2009, 08:47 #3
Line 98, Column 73: character "<" is the first character of a delimiter but occurred as data.
…submit="return checkForm();" action="<?php echo $_SERVER['PHP_SELF']; ?>" met
document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
<label class="personal_data_label">Your Name</label>
Line 128, Column 32: end tag for "body" omitted, but OMITTAG NO was specified.
<?php include("footer.html"); ?>
Mar 26, 2009, 09:16 #4
You must validate the result of the script after the PHP has been executed. The page as it arrives at your browser. Just validate the pagename.php, don't save it as pagename.html.
Mar 26, 2009, 09:20 #5
Sorry, I am unable to validate this document because its content type is application/octet-stream, which is not currently supported by this service.
The Content-Type header is sent by your web server (or web browser if you use the file upload interface) and depends on its configuration. Commonly, web servers will have a mapping of filename extensions (such as ".html") to MIME Content-Type values (such as text/html).
Mar 26, 2009, 09:44 #6
- Join Date
- May 2007
- Portsmouth, UK
- 0 Post(s)
- 0 Thread(s)
To rephrase what has been said:
If you put your .php on a testing server and then browse to it using your internet browser of choice, right click and click view source, save this as an html file and then validate that.
Upload the .php to a live server and direct the validator to the URL
Hope that is a bit easier to understand
Mar 26, 2009, 09:50 #7