开发者

Inserting special chars, title splitter

I am going to do so the webtitle <title> is stored in the db, so you can change it without editing file..

I have both the title and a title splitter..

Like this:

page.com • 

the page.com is the title and the • is the splitter开发者_JAVA技巧

Im having little issue by inserting the splitter, • into the database. I tried insert it as it is, • and by the html code &bull;.

The first try by having • is that it turns out as ? in my varchar field, Second try by having &bull; is that in the webtitle it shows also as &bull; and not the actual icon/symbol.

How can i fix this and have it accept chars so they dont turn out as ? or ??

Should i use another columntype than varchar maybe?


first, title does not allow html-entities

imho, you should store as &bull;
and only manipulate/convert that into its original character when you outputing HTML


&bull; should actually do the trick. look at your final html code that loaded to the browser. may be there are some escaping characters


That is exactly the way you should store it. I'm not sure why your browser is not displaying it. I just tested with Mozilla and it work's fine for me.

<title>&bull; <- thats a bullet</title>


Varchar should be fine. . .

When you send your data, or gather it from your DB, are you sending it through anything like htmlspecialchars() ? Make sure you're actually sending the string, and not a stripped version of the string.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜