Jump to content


Photo

Valid XHTML problem


  • Please log in to reply
4 replies to this topic

#1 ChaosXero

ChaosXero
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 26 August 2006 - 03:36 PM

I use Amazon Ads on a site that I maintain (it's for a library) and when I try to validate the XHTML, it goes haywire on the ad.

http://validator.w3.....0 Transitional

Anyone know why this happens and if I can fix it.  It irks me when my pages dont validate.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 August 2006 - 03:43 PM

As you are using XHTML Doctype you must close all tags. If you have tags that dont have a closing tag you have to have (space)/ before >

So for the link tag it should be this:
<link href="final.css" rel="stylesheet" type="text/css" />

the same for meta, input, hr, br tags etc or any other tag that doesnt have a closing tag.

As for the errors with the Amazon Ads. You cant really fix them.

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 26 August 2006 - 03:47 PM

<link href="final.css" rel="stylesheet" type="text/css">

Should be:

link href="final.css" rel="stylesheet" type="text/css"/>

That'll fix the errors with link, meta tags etc.

You can fix the Amazon errors (almost certainly). The problem is caused by the ampersands.  They need to be changed from & to &amp; either by manual editing or by changing the argument separator as described at http://www.w3.org/QA.../04/php-session

ini_set('arg_separator.output','&amp;');

Legend has it that reading the manual never killed anyone.
My site

#4 ChaosXero

ChaosXero
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 26 August 2006 - 04:28 PM

Thanks a lot, I was wondering about that, didn't realize I needed a space.  I'll look into the amazon ads.

I'm unfamiliar with INI_SET will I have to run that once, and will it make my adresses site.org/?var=etc&ampvar2=etc?

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 August 2006 - 04:36 PM

No, &amp ; (without the space) is the html entity of & (ampersand)

The link will be this in your html:
mysite.com/page.php?var=foo&amp;var2=bar
However when you hover over the link it'll display as:
mysite.com/page.php?var=foo&var2=bar
It allows you to keep your page XHTML valid.

However I dont think this will help, as this will only afect urls to your site and not urls going to other sites (amazon).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users