![]() |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0
![]() OS:
|
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" /> 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.. |
|
|
|
|
|
#2 |
|
Founder
![]() Join Date: Nov 2005
Location: The Last City Zion!
Posts: 3,539
Thanks: 287
Thanked 345 Times in 298 Posts
Rep Power: 62
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() OS:
|
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 < for '<' and > for '>'. But doing so might break the cookie loading function and thus the style switching.
__________________
Want to ask a question? Try This! A guide on how to post a question, reply to a post etc.
Last edited by Strider; 02-06-2009 at 09:18 PM.. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0
![]() OS:
|
Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error
Already tried that. I am wondering if it's a W3C Validation gremlin?
|
|
|
|
|
|
#4 |
|
Founder
![]() Join Date: Nov 2005
Location: The Last City Zion!
Posts: 3,539
Thanks: 287
Thanked 345 Times in 298 Posts
Rep Power: 62
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() OS:
|
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 |
|
|
|
|
|
#5 |
|
Newbie
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0
![]() OS:
|
Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error
I will contact the author.
Thanks for your help anyway. |
|
|
|
|
|
#6 |
|
Newbie
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0
![]() OS:
|
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. |
|
|
|
|
|
#7 | |
|
Founder
![]() Join Date: Nov 2005
Location: The Last City Zion!
Posts: 3,539
Thanks: 287
Thanked 345 Times in 298 Posts
Rep Power: 62
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() OS:
|
Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error
Quote:
Could you please find the modified code. I'm interested in seeing the changes you made to make it valid. ![]() |
|
|
|
|
|
|
#8 |
|
Newbie
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0
![]() OS:
|
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.. |
|
|
|
| Thanked Users: | Strider (03-06-2009) |
|
|
#9 |
|
ƒ(ψ)=ΘΊΧφ
![]() |
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 |
|
|
|
|
|
#10 |
|
Newbie
Join Date: May 2009
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
Rep Power: 0
![]() OS:
|
Re: PHP Style Switcher - XHTML 1.0 Strict Validation Error
Yes - it's the closing tag for the link.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |