edman
05-14-2006, 12:06 PM
Hi,
I'm trying to validate my XHTML site but I have some PHP on all the pages which is getting in the way, its just a small script which takes the time and date from the server and adjusts it to my correct time zone and then prints it on the screen.
It looks like this:
<?php
$timeadjust = (10800);
$todaysdate = date ('l F j, Y <br> g:i a', time() - $timeadjust);
print $todaysdate;
?>
When I try to validate I get these 3 errors:
1. Error Line 79 column 25: character "," not allowed in attribute specification list.
2. Error Line 79 column 25: element "bSun" undefined.
3. Error Line 80 column 5: end tag for "bSun" omitted, but OMITTAG NO was specified.
Obviously these errors are resulting from the HTML code which is generated by the PHP script when it retrieves the date and time because the "bSun" does not appear on the php document at all.
SO....long story--->short....how do I escape the PHP for validation and still be able to use the PHP to generate date and time? because I tried <[CDATA[ ]]> tags and <!-- --> tags and that didnt work, it didnt allow the PHP to be seen at all. Thanks in advance to anyone who can help.
Edman
I'm trying to validate my XHTML site but I have some PHP on all the pages which is getting in the way, its just a small script which takes the time and date from the server and adjusts it to my correct time zone and then prints it on the screen.
It looks like this:
<?php
$timeadjust = (10800);
$todaysdate = date ('l F j, Y <br> g:i a', time() - $timeadjust);
print $todaysdate;
?>
When I try to validate I get these 3 errors:
1. Error Line 79 column 25: character "," not allowed in attribute specification list.
2. Error Line 79 column 25: element "bSun" undefined.
3. Error Line 80 column 5: end tag for "bSun" omitted, but OMITTAG NO was specified.
Obviously these errors are resulting from the HTML code which is generated by the PHP script when it retrieves the date and time because the "bSun" does not appear on the php document at all.
SO....long story--->short....how do I escape the PHP for validation and still be able to use the PHP to generate date and time? because I tried <[CDATA[ ]]> tags and <!-- --> tags and that didnt work, it didnt allow the PHP to be seen at all. Thanks in advance to anyone who can help.
Edman