2009/8/29 Nisse Engström <news.nospam.0ixbt...@luden.se>:
> On Fri, 28 Aug 2009 17:22:20 -0600, LinuxManMikeC wrote:
>
>> <a href="<?php echo $url; ?>">click here</a>
>
> *Groan*
>
> Throw any random web site to an HTML validator
> and you're likely to see this kind of slop all
> over.
>
> The correct solution is of course:
>
>  $u = htmlspecialchars ($url);
>  echo "<a href=\"$u\">$u</a>";
>
>

Right... you do realize that you validate the HTML output of the
executed PHP script, not the PHP script itself.  All you really did
was just show another way to skin the same cat.  Get over yourself.
As for your "more elaborate example", I'm sure that heredoc will
validate nicely.  It also wouldn't hurt to read a book on algorithms
and rethink your code so you aren't processing the same data over and
over again.  I "see this kind of slop all over."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to