XHTML <a href="<?php echo $var; ?>">

As the subject suggests, I’m having troubles using a PHP variable as the href in XHTML. XHTML is stricter than HTML, so it’s trying to tell me that the file is not well formed XML. I’m not sure how to get around this.

[php]

[/php]

You can’t put direct PHP into an XHTML tester. You have to direct a tester to a web-page which has all the values sorted properly.

Sponsor our Newsletter | Privacy Policy | Terms of Service