Jump to content

How to validate following PHP Page


wise32

Recommended Posts

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.