开发者

Bad value mailto

Can someone point out what I'm doing wrong here. On W3c validator I get this error:

Line 104, Column 43: Bad value mailto:?subject=Test&body=I found this today and i thought you might be intrested. URL/2011/05/test/ for attribute href on element a: Control character in query component. … URL/2011/05/test/">http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20

And this is the code I'm using in header.php:

<div style="float:left; width:25px; height:25px; padding:5px; margin-left:3px;">
    <a href="mailto:?subject=<?php the_title_attribute() 开发者_如何学Go?>&amp;body=I found this today and i thought you might be intrested.
    <?php echo get_permalink(); ?>"><IMAGE SOURCE="<?php echo $template_url ?>/social/email-small.png" title="E-Mail"></a>
</div>

Its under<!DOCTYPE html> if that matters. Thanks in advance.

Sorry it made me break the links i just replaced with URL and IMAGE SOURCE


Encode the parameters.

You can use urlencode() in PHP.


You need to use urlencode() to encode any URLS you include in there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜