TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Software World > Programming

Notices

PHP Style Switcher - XHTML 1.0 Strict Validation Error

Programming


Reply
 
Thread Tools Display Modes
Old 02-06-2009, 12:55 PM   #1
Col
Newbie
 
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0 Col is an unknown quantity at this point


OS: Windows Vista


PHP Style Switcher - XHTML 1.0 Strict Validation Error

At long last I have managed to actually get a php style switcher to work. Unfortunately, one line of code stops my page from validating as xhtml 1.0 strict. What do I have to do to the following code to make the page validate?

Code:
<link rel="stylesheet" type="text/css" media="screen" title="User Defined Style" href="<?php echo (!$_COOKIE["sitestyle"])?'default':$_COOKIE["sitestyle"]?>.css" />
with the error messages:

Line 10, Column 88: character "<" is the first character of a delimiter but occurred as data …n" title="User Defined Style" href="<?php echo (!$_COOKIE["sitestyle"])?'defa

Line 10, Column 120: an attribute value literal can occur in an attribute specification list only after a VI delimiter …ef="<?php echo (!$_COOKIE["sitestyle"])?'default':$_COOKIE["sitestyle"]?>.css


Anyone have a solution to this problem?

Last edited by Strider; 02-06-2009 at 06:15 PM..
Col is offline   Reply With Quote
Old 02-06-2009, 06:21 PM   #2
Founder
 
Strider's Avatar
 
Join Date: Nov 2005
Location: The Last City Zion!
Posts: 3,539
Thanks: 287
Thanked 345 Times in 298 Posts
Rep Power: 62 Strider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just Great


OS: Windows XP Windows Server 2003 / Windows Server 2008 Windows Vista Windows 7 Linux


Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

I guess you should live with the validation error. To get it passed you should use &lt; for '<' and &gt; for '>'. But doing so might break the cookie loading function and thus the style switching.

Last edited by Strider; 02-06-2009 at 09:18 PM..
Strider is offline   Reply With Quote
Old 02-06-2009, 07:00 PM   #3
Col
Newbie
 
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0 Col is an unknown quantity at this point


OS: Windows Vista


Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

Already tried that. I am wondering if it's a W3C Validation gremlin?
Col is offline   Reply With Quote
Old 02-06-2009, 09:22 PM   #4
Founder
 
Strider's Avatar
 
Join Date: Nov 2005
Location: The Last City Zion!
Posts: 3,539
Thanks: 287
Thanked 345 Times in 298 Posts
Rep Power: 62 Strider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just Great


OS: Windows XP Windows Server 2003 / Windows Server 2008 Windows Vista Windows 7 Linux


Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

I see. Did you contact the author of this code? Email him or post a comment in his blog.

PHP Style Switcher | JavaScript Workshop
Strider is offline   Reply With Quote
Old 02-06-2009, 10:02 PM   #5
Col
Newbie
 
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0 Col is an unknown quantity at this point


OS: Windows Vista


Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

I will contact the author.

Thanks for your help anyway.
Col is offline   Reply With Quote
Old 02-06-2009, 10:31 PM   #6
Col
Newbie
 
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0 Col is an unknown quantity at this point


OS: Windows Vista


Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

Never contacted the author, as I could not remember where I had the code from.

Have found the solution now anyway - and the page validates as xhtml 1.0 strict.

Thanks for your help in this matter, it was appreciated.
Col is offline   Reply With Quote
Old 03-06-2009, 10:55 AM   #7
Founder
 
Strider's Avatar
 
Join Date: Nov 2005
Location: The Last City Zion!
Posts: 3,539
Thanks: 287
Thanked 345 Times in 298 Posts
Rep Power: 62 Strider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just GreatStrider is just Great


OS: Windows XP Windows Server 2003 / Windows Server 2008 Windows Vista Windows 7 Linux


Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

Quote:
Have found the solution now anyway - and the page validates as xhtml 1.0 strict.

Could you please find the modified code. I'm interested in seeing the changes you made to make it valid.
Strider is offline   Reply With Quote
Old 03-06-2009, 01:43 PM   #8
Col
Newbie
 
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0 Col is an unknown quantity at this point


OS: Windows Vista


Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

The following code validates as xhtml 1.0 strict

Code:
<link rel="stylesheet" type="text/css" media="screen" title="User Defined Style" /> <?php echo href=(!$_COOKIE["sitestyle"])?'default':$_COOKIE["sitestyle"].css /> ?>

Last edited by Strider; 03-06-2009 at 07:10 PM..
Col is offline   Reply With Quote
Thanked Users:
Strider (03-06-2009)
Old 03-06-2009, 06:08 PM   #9
ƒ(ψ)=ΘΊΧφ
 
bakuryu's Avatar
 
Join Date: May 2006
Location: India
Age: 23
Posts: 6,621
Thanks: 19
Thanked 645 Times in 603 Posts
Rep Power: 87 bakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant future


OS: Windows XP Windows Vista Windows 7


Send a message via Yahoo to bakuryu
Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

do you require this /> ?

<link rel="stylesheet" type="text/css" media="screen" title="User Defined Style" /> <?php echo href=(!$_COOKIE["sitestyle"])?'default':$_COOKIE["sitestyle"].css /> ?>
__________________
Please don't click here
bakuryu is offline   Reply With Quote
Old 03-06-2009, 06:52 PM   #10
Col
Newbie
 
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0 Col is an unknown quantity at this point


OS: Windows Vista


Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error

Yes - it's the closing tag for the link.
Col is offline   Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 07:42 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional