On Tue, Jan 11, 2011 at 22:35, David McGlone <david@xxxxxxxxxxxxx> wrote: > Hi Everyone, I'm having a problem validating some links I have in a foreach. > Here is my code: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd"> > > my PHP code: > $categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', > 'testimonials'); > foreach($categorys as $category){ > $replace = str_replace("_", " ", $category); > echo "<li><a href='index.php?page=$category'>$replace</a></li>"; > } > > Validator Error: > an attribute value must be a literal unless it contains only name characters This is because you misspelled $categorys, where it should actually be $categories. In some of the most recent updates to the core, primarily by Felipe Pena, PHP will now, by default, kick out errors in validation due to misspellings and incorrect grammar. To override this, you must uncomment the following line in your system's php.ini: ;human = true This will allow the parser to understand that you're human, thus capable of mistakes. Please keep in mind, however, that it's only able to be set in php.ini. This is to keep bots and the like from hijacking shared hosts, where an INI_PERDIR setting could potentially be written to the local account by exploitation of a variety of means (including, but not limited to, XSS, file inclusion, and SQL injection techniques). While it may seem a bit of a hassle to need to take this extra step, we all agree that Felipe has done this with the best interests of the community at heart. Having seen the substitutions of 'r' for 'are' and 'u' for 'you' (among many others), he has single-handedly taken it upon himself to use PHP not only as a tool to assist in technological projects, but as a means to teach proper spelling, grammar, and even punctuation to the world (in PHP 7, semicolons will be replaced by commas, periods, and question marks, as appropriate). To learn more about his efforts, go to http://ca2.php.net/spelling-enforcement.php -- </Daniel P. Brown> Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php