Any help on this matter will be appreciated. I know very little about the subject, as you'll probably notice. I'm currently working on validating my site. It's written in XHTML/CSS and includes a PHP script on every page for tracking purposes. According to W3C, every page is completely valid - that is, until I save the pages as .php. When I do this, the pages all become invalid. Is that normal? The thing is, I have to save the pages as .php or the PHP codes won't work. What can I do?
Hmmm there shouldn't be a problem in theory. Could you post a link to the site so I can see what errors it's coming up with on W3C?
Thanks for the responses, guys. I can't upload the pages as they will overwrite my existing site's pages. Basically, every page is totally valid as a .html, but when I save them as .php, I get these errors: file:///C:/Program%20Files/CoffeeCup%20Software/~validate.html Here's the code of one of my pages: <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="cs" /> <meta name="robots" content="all,follow" /> <meta name="author" content="www.couponstoyourinbox.com" /> <meta name="description" content="Never Pay Full Retail Prices! Get the Latest Discount Coupons for Your Favorite Stores!" /> <meta name="keywords" content="coupons, coupon codes, discount coupons, discount codes, discount coupon codes, email coupons, coupons by email, e mail coupons, coupons by e mail, email coupon codes, e mail coupon codes, free email coupons, free e mail coupons, email discounts, e mail discounts." /> <link rel="stylesheet" type="text/css" href="couponstoyourinbox.css" /> <title>Coupons To Your Inbox | About Us</title> <script type="text/javascript" src="menu.js"></script> </head> <body> <div id="thetop"><a id="top"></a></div> <div id="container"> <div id="header"> <table class="center" width="75%" border="0" cellpadding="0" cellspacing="0"> <tr> <td><a href="index.php"><img src="img/header-small.png" width="300" height="90" style="border-style:none" alt="" /></a></td> </tr> </table> </div> <div id="menu"> <script type="text/javascript" src="couponstoyourinbox.js"></script> </div> <div id="main"> <img src="img/about-header.png" alt=""/> <p style="text-align:justify">Established in early 2008, Coupons To Your Inbox is an ever-growing resource, presenting all the latest deals and discount coupon codes for a number of online retailers, along with articles and videos that convey advice and tips intended to help visitors save money on bills and other expenses.</p> <p style="text-align:justify">An additional and very convenient service offered by Coupons To Your Inbox is that visitors can sign up to receive deals and discount coupon codes by e-mail. Visitors can opt to receive all deals and discount coupons or just those from retailers which serve a particular market, such as Health and Beauty, Apparel, etc. This saves visitors from having to return to the site to learn whether or not new coupons have been released or new sales have been launched. More importantly, visitors no longer have to contend with the hassle of trying to find coupons for their favorite online retailer. Registration for e-mail notifications can be achieved via the Receive Coupons by E-mail box located at the right-hand side of each page. Prospective subscribers are only asked for a first name and e-mail address, both of which are kept in the strictest of confidence. Please refer to our <a href="privacy.php">Privacy Policy</a> for more details on security.</p> <h3 class="headerstyle">About the Web Site</h3> <p style="text-align:justify">CouponsToYourInbox.com is a quick-loading XHTML 1.1/CSS web site with a Javascript main menu and PHP accessories. The web site's design focuses strongly on presentation and especially ease of navigation and use. The markup coding conforms to the WCAG 1.0 Triple-A rating and is thus renderable in all common browser types.</p> <p class="internallink">[ <a href="#top">Back to top</a> ]</p> </div> <div id="right"> <img src="img/opt-in-header.png" alt=""/> <table class="center" style="text-align:left" width="90%" border="0" cellpadding="0" cellspacing="0"> <tr> <td style="background-color:#e8e8e8"> <form method="post" action="http://www.aweber.com/scripts/addlead.pl"> <table width="89%" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <input type="hidden" name="meta_web_form_id" value="1996592480" /> <input type="hidden" name="meta_split_id" value="" /> <input type="hidden" name="unit" value="coupon-delivery" /> <input type="hidden" name="redirect" value="http://www.couponstoyourinbox.com/thank-you.php" id="redirect_f1987bb22c74082d6e85ba884f46d824" /> <input type="hidden" name="meta_redirect_onlist" value="" /> <input type="hidden" name="meta_adtracking" value="about" /> <input type="hidden" name="meta_message" value="1" /> <input type="hidden" name="meta_required" value="name,from" /> <input type="hidden" name="meta_forward_vars" value="0" /> <table> <tr><td colspan="2"><input type="checkbox" name="custom All" /> All</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Clothes and Shoes" /> Apparel</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Automotive" /> Automotive</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Parenting" /> Babies and Kids</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Books" /> Books</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Electricals" /> Electronics</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Health and Beauty" /> Health and Beauty</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Furniture and Decor" /> Home and Garden</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Movies" /> Movies</td></tr> <tr><td colspan="2"><input type="checkbox" name="custom Superstores" /> Superstores</td></tr> <tr><td>Name:</td><td><input type="text" name="name" value="" size="20" /></td></tr> <tr><td>Email:</td><td><input type="text" name="from" value="" size="20" /></td></tr> <tr><td align="center" colspan="2"><input type="submit" name="submit" value="Submit" /></td></tr> </table> </td> </tr> </table> </form> </td> </tr> </table> <br/> <table class="center" style="text-align:justify" width="88%" border="0" cellpadding="2" cellspacing="0"> <tr> <td> Please choose which coupons you would like to receive and submit your name and e-mail with complete confidence. We will never share, rent or sell your details. Note that you can unsubscribe at any time with a simple click. </td> </tr> </table> </div> <div class="clear"></div> </div> <div id="footer"> <p><a href="index.php">Home</a> | <a href="about.php">About</a> | <a href="contact.php">Contact</a> | <a href="privacy.php">Privacy</a> | <a href="terms-and-conditions.php">Terms & Conditions</a> | <a href="site-map.php">Site Map</a></p> <p><a href="#top">Coupons by Category (Top)</a> | <a href="coupons-by-store.php">Coupons by Store</a> | <a href="a-to-z-of-stores.php">A to Z of Stores</a> | <a href="how-to-save-money-articles.php">Articles</a> | <a href="how-to-save-money-videos.php">Videos</a></p> <p>Copyright © 2008 www.CouponsToYourInbox.com. All Rights Reserved.</p> <p><img src="img/valid-xhtml11.gif" alt="Valid XHTML 1.1" height="31" width="88"/> <img src="img/w3c-valid-css.png" alt="Valid CSS"/></p> </div> </body> </html>
Just upload a test versions of a couple of the pages (maybe just add a suffix letter to the file names) -- that should do the trick. Most of those who would like to offer help and suggestions want to run the validation themselves so that they can observe the actual validator output. James
So we don't have to repeat too much, here is the original thread where the errors were discovered: http://forums.digitalpoint.com/showthread.php?t=815439 I missed your question there, but I know that removing the <center> tags, language="javascript" and the lack of block element around the inside of <form> should NOT stop anything from working (although if the <center> tags really are centering something, then, without PHP, those elements wouldn't be in the center I guess). If the PHP is adding this stuff, then, is it part of some template script or something? Templates would make sense to me-- they always have this kind of stuff in them (which is why they are usually HTML 4 or XHTML 1.0 transitional doctype). But I don't know anything about PHP... these are just includes? Do you get the same errors if it's just Echo?
Hi, Stomme Poes, Thanks to your and everyone else's help, and especially the help of Jamesicus, I have managed to fix all errors. My only problem now is that I have to save the pages as .php. When I do so, the pages all become invalid again. I have uploaded a test page as both .html and .php to a different domain: http://www.easy-ringtones.info/test.html http://www.easy-ringtones.info/test.php Why is the .html one valid and the .php one invalid? Note that the test page is in my new design. My old design was deemed old fashioned by you guys. I hope you like the new one.
Currently, they both seem to be valid. Good job. However the php one is still spitting out a bunch of crud right before the doctype, which is going to give IE fits (it will think there is no doctype at all, and revert to its caveman state, acting like IE5): <?php error_reporting(0); $href = urlencode(eregi_replace("%3F", "", $_SERVER['HTTP_REFERER'])); $expirytime = time()+9600000; $cookiename = 'xconversions'; $ad = "about"; $campaign = "couponstoyourinbox"; $OVKEY = urlencode($_REQUEST['OVKEY']); $bid_keyword = urlencode($_REQUEST['bid_keyword']); $uagent = $_SERVER['HTTP_USER_AGENT']; if ((stristr($uagent, 'Google') != false)){} elseif (isset($_COOKIE[$cookiename])) $var = $_COOKIE[$cookiename]; else{ if(isset($_REQUEST['campaign'])) $campaign = $_REQUEST['campaign']; if(isset($_REQUEST['ad'])) $ad = $_REQUEST['ad']; if($href ||(($bid_keyword)) || (($OVKEY))) { include "http://www.bargain-market.net/xtreme3/secret.php?href=$href&campaign=$campaign&ad=$ad&OVKEY=$OVKEY&bid_keyword=$bid_keyword©right=CopyRighted+For+Amir+Darwish+of+Xconversions.com+EXCLUSIVELY"; setcookie($cookiename,$var,$expirytime, "/" ,"www.couponstoyourinbox.com" ); } } if(!isset($key)) $key=""; ?> Code (markup): If there's error reporting to be done, it needs to send all that junk to an actuall error log, not the html sent to the browser : ) Not that I have any clue how you would do that. Also, earlier you asked me how you could get the form on the right to stay at the correct size for all browsers. The answer is, very difficultly, I would think, because the table is doing what tables do-- it's expanding the width of its cells to accommodate the content. Other than setting a width on table headers, I haven't figured out how to keep table cells at a certain width. I didn't look to see if there was a width on the form... that might contain the table, I'm not sure. Or setting a width on the table itself. But tables are one of those things that grow to meet the needs of the content, while other elements would just either let stuff run over, or would clip it off, depending on what your settings were. *edit, looked again... you could change the width from 90% to something in pixels... not that growing a little bit is a bad thing-- it can actually be a good thing, helping people see it better. In which case, the better solution might be to set the width of the whole sidebar thingie in % so it can grow too. That might not look as weird. The design seems nice enough to me... I'm actually not that picky about how sites look though. But I do like fonts... and you might want to do some more looking into different fonts. Learn what's free, what's common on people's machines,and what you can use in images (sitting over real text, of course-- google "Gilder Levin image replacement"). Gotham is a very clean font... possibly a Gotham Bold would look nice on your new clean site. As an image, since Gotham isn't a popularly installed font that I know of. Right now, your text is locked in those images. Turn images off, like a lot of dial-uppers do, and there's just nothing. There should be some text behind the images... something for teh googles and the blind and the imageless to read : )
Stomme Poes, Thanks for your help, man. I no longer have any problems. It seems that my only problem is stupidity! I've just tried to validate my .html and .php pages online and they were both presented as being valid, just like you said! It seems that the one with the .php extension needed to be online to be valid. When I tried to validate it off line, from my HTML editor, it was presented as being invalid. My apologies for wasting your time. Thanks for all your help. I appreciate it.
Lawlz, that's the way it goes : ) You might sometimes also find problems with scripts and IE when the files are local. But, you'll still need to get rid of that...whatever it is... sitting atop your doctype. Otherwise, you look good to go. Not a waste of time-- you've learned a lot.
Congratulations on producing a page that Validates as XHTML 1.0 Strict! Now you need to change the references and validation icon on the page from XHTML 1.1 to XHTML 1.0. The PHP scripting runs on the server side so it will not cause any IE6 problems. As part of your great learning adventure, Masterful, you might now want to explore modifying your markup a little -- maybe re-think some of your table usage? But, congratulations on a job well done! James