W3C Validation Problems

Soldato
Joined
27 Dec 2005
Posts
17,316
Location
Bristol
I feel like I'm posting a thread a day here so sorry for the spam. I'm currently trying to W3C validate and tidy up the code of a site, most of which I can deal with fine and are simply things that I've slipped up on before.

However I'm currently trying to validate a page containing a form. W3C is kicking up 1 warning and 2 errors:

NET-enabling start-tag requires SHORTTAG YES.
…e="4e1645ad2d53477f131f242a2c26b488" />

document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag.
…e="4e1645ad2d53477f131f242a2c26b488" />

character data is not allowed here.
…="4e1645ad2d53477f131f242a2c26b488" />

Now after moving some code around to try and get a look at what precedes that example it turns out that it's the forms hidden text field containing the users PHPSESSID. I haven't coded this so I assume it's inputted by the browser automatically. Which raises the question, how on earth do I go about fixing it?
 
lol i remember that NET-enabling start-tag requires SHORTTAG YES, as it was the only error stopping my site from being xhtml strict. I googled it a whole day and still found nothing. The general concensus was to basically remove the offending code :/
 
Put the in <input> tags inside <div> tag to fix the second one.

Third... post some more code.

This is the problem - I can't because the problematic code isn't present in my original files.

This is the code from my file:

Code:
<div style="text-align: center;">
<form name="form1" method="post" action="?a=dvd&amp;action=dvd">
<div></div><table class="tableDVD">

and this is what W3C sees:

Code:
<div style="text-align: center;">
<form name="form1" method="post" action="?a=dvd&amp;action=dvd">
<input type="hidden" name="PHPSESSID" value="d5aba3d3ffe0f1a40906b20ab444e1ca" />
<div></div><table class="tableDVD">

And it's this which is causing the error with its "/>".
 
I've just been on your website, and for some reason the PHPSESSID came up when click on links. Eg: http://www.rghjones.co.uk/?a=videography&PHPSESSID=09d94096f39a0b5fea0972fb44c2bba2

Secondly, taking a look at your current sites code, at the bottom, below the </html> tag you seem to have links to varies spam/porn/virus sites. Whether the software you are using to code has a virus, or something is wrong on your web server.
 
having just looked at the validator page for your site.. it's the spam stuff that is failing validation.

Remove your webservers virus and it'll probably clear the errors. :p

edit: except for this one:
Code:
<strike>take a look around.</strike>
those should be <del> tags. :)
 
Last edited:
I've just been on your website, and for some reason the PHPSESSID came up when click on links. Eg: http://www.rghjones.co.uk/?a=videography&PHPSESSID=09d94096f39a0b5fea0972fb44c2bba2

Secondly, taking a look at your current sites code, at the bottom, below the </html> tag you seem to have links to varies spam/porn/virus sites. Whether the software you are using to code has a virus, or something is wrong on your web server.

Not sure where the hell they came from. Fixed temporarily by replacing the original file (I use Notepad++) and will send a note to my hosting company.

Thanks for pointing this out, BUT it's not actually the site in my sig I'm trying to validate :p. Here's the validation in question to the OP:

http://validator.w3.org/check?uri=h...e&ss=1&group=0&user-agent=W3C_Validator/1.591
 
On a similar topic as mentioned above, I'm trying vainly to research how to get rid of PHPSESSID from links, and also from Google's index as more than half the pages are. Anyone got any good sources for this?
 
I add the following two ini_set rules to my header.php files:
ini_set("arg_separator.output", "&amp;amp;");
ini_set("session.use_only_cookies", "1");

The first one forces PHP to use &amp; rather than &, so it's standards compliant if you're outputting XHTML. The second one forces PHP to use cookies rather than the session ID on your links. Besides looking awful, there are some security issues with that, as people can hijack sessions much more easily.
 
Back
Top Bottom