wise32 Posted April 21, 2012 Share Posted April 21, 2012 Dear friends, I have the following PHP page. I have to validate it from W3C online Validator. I am using this page as a frame in a another page. It works well without any error. But gives 4 errors in validation. I have tried many tweaks (Including saving without BOM) but all in vain. I am to need to validate the code only on website (by giving URL to validator). Webpage is attached with this post. So please guide me about it. The problem is that 1. When code is directly input to online Validator then following errors appears. Line 98, Column 7: xmlParsePI : no target name <?=strtoupper($objRow->title);?></a></b><br /> Line 99, Column 89: xmlParsePI : no target name …a, Arial, Helvetica, sans-serif; font-size:11px;">(<?=$objPro->tname;?>)</span> Line 101, Column 10: xmlParsePI : no target name <td><?=$objRow->keyword;?></td> Line 102, Column 10: xmlParsePI : no target name <td><?=$objRow->short_desc;?></td> Line 103, Column 10: xmlParsePI : no target name <td><?=$objRow->detail_desc;?></td> Line 104, Column 39: xmlParsePI : no target name <td bgcolor="<?=$Color;?>"><?=$Action;?></td> 2. when I hosted my site and validated that page by giving the URL to Validator then the following errors appears. Line 1, Column 5: no document type declaration; will parse without validation <h1>Session Expire Now.......Please Login First</h1> Line 2, Column 5: document type does not allow element "P" here <p> Line 7, Column 9: end tag for element "BODY" which is not open </body> Line 8, Column 7: end tag for element "HTML" which is not open </html> 18155_.txt Quote Link to comment Share on other sites More sharing options...
kicken Posted April 22, 2012 Share Posted April 22, 2012 1. When code is directly input to online Validator then following errors appears. You can't validate the page with the PHP code in it still. You have to run the output of the php through the validator. 2. when I hosted my site and validated that page by giving the URL to Validator then the following errors appears. When the validator hits your page, it will not have a valid session. As such it is going to see the output for your session expired notice, which ends up generating a page consisting of: <h1>Session Expire Now.......Please Login First</h1> <p> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a> </p> </body> </html> Notice you have no header, no doctype, no body opening tag, etc. All this is missing because it is contained inside your if statement and only gets output if there is a valid session. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.