Making pages XHTML compliant: ERRORS

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Making pages XHTML compliant: ERRORS

Post by raghavan20 »

Question - 1:
Normally, I know that url variables have to be encoded.
but here, i encoded the & with & before id but its showing an error where PHPSESSID comes which I dont access to change it.
the php without my knowledge passes session variable in URL. how do change that & to &?

Code: Select all

# Warning  Line 27 column 75: cannot generate system identifier for general entity "PHPSESSID".

...index.php?action=selectRoom&id=1&PHPSESSID=5fce671bb78e20e676549699ef6344

An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.

If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.

Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.

✉
# Error Line 27 column 75: general entity "PHPSESSID" not defined and no default entity.

...index.php?action=selectRoom&id=1&PHPSESSID=5fce671bb78e20e676549699ef6344

This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
Last edited by raghavan20 on Tue Sep 13, 2005 3:53 pm, edited 3 times in total.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Question - 2:
guys, see whether you can help with a different error
its tells that a select tag is not closed.

http://validator.w3.org/check?uri=http% ... ype=Inline

original file link:
http://raghavan.100webcustomers.com/index.php
Please login to chatMainPage.php

Code: Select all

Error  Line 147 column 12: end tag for "select" which is not finished.

				</select>

Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, <head> generally requires a <title>, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.

view source output

Code: Select all

<form name="frmUsers" action="">
				<select id="usersWindow" class="select" size="16" onchange="modifyCookie(this.value);">
				</select>
			</form>
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: Making pages XHTML compliant: ERRORS

Post by Roja »

raghavan20 wrote:Question - 1:
Normally, I know that url variables have to be encoded.
but here, i encoded the & with & before id but its showing an error where PHPSESSID comes which I dont access to change it.
the php without my knowledge passes session variable in URL. how do change that & to &?
The error message LINKS to the article explaining how to fix it! GAH!
If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.
Cmon, at least READ and CLICK the error message links! :)
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

thanks for that Roja regd question - 1; i badly missed the link and i have corrected it now

i have got another error
question: 3
it says the document type does not allow fieldset tag...what dtd should i used to make sure fieldset tag is available?

source file: http://raghavan.100webcustomers.com/index.php

Code: Select all

Error  Line 32 column 12: element "FIELDSET" undefined.

			<FIELDSET>

You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:

    * incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
    * by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
    * by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

raghavan20 wrote: it says the document type does not allow fieldset tag...what dtd should i used to make sure fieldset tag is available?
Xhtml tags are all lowercase.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

I totally forgot that XHTML tags should be in lowercase as I was thinking somethingelse

I have got only one problem and managed to solve many others
source: http://raghavan.100webcustomers.com/chatMainPage.php
I dont see any violation as select is closed and its wrapped in form tag.

Code: Select all

Error  Line 147 column 12: end tag for "select" which is not finished.

				</select>

Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, <head> generally requires a <title>, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

raghavan20 wrote: Error Line 147 column 12: end tag for "select" which is not finished.
A SELECT element must contain at least one OPTION element.

http://www.w3.org/TR/REC-html40/interact/forms.html

(And yes, that applies in XHTML, which only lists deviations from html, so I couldnt directly reference it).
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

actually, I use javascript to dynamically add options what should I do now???
may be i can put some static entry and clear all the entries and load the new ones.
have you got any other better Roja?
thanks for all your help.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

raghavan20 wrote:actually, I use javascript to dynamically add options what should I do now???
may be i can put some static entry and clear all the entries and load the new ones.
have you got any other better Roja?
thanks for all your help.
Thats exactly right - I would have one placeholder, and dynamically add the others.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Question - 4:
Click here
I have a page where I used this to change & in urls as &

Code: Select all

<?php ini_set('arg_separator.output','&'); ?>
Is this only meant for changing & before PHPSESSID only?
or can change anything like someurl.php?action=editBlog&id=5 to someurl.php?action=editBlog&id=5???
will it change the & before id to &amp?
it does not change in the above url, I dont know why :?
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

I have common situation where a php file named A has html and php code.
another file which has php code only, may be a database connection file named B.
if B includes A, then B also becomes XHTML invalid.
Is there anything can be done about it???
Post Reply