doubei2340 2012-08-29 13:24
浏览 151
已采纳

META描述和Facebook

This is my dynamic title and meta description update code;

$titlecek=mysql_query("SELECT bahisisim,bahisiaciklama,URL FROM bahis WHERE id='$bahisid'");
$titlecekx=mysql_fetch_array($titlecek);
echo "<title>" . mb_strtolower($titlecekx[0],'UTF-8') . "</title>";
echo '<META NAME="Description" CONTENT="' . mb_strtolower($titlecekx[1],'UTF-8') . '">';

But when I try to share my page at Facebook it looks like;

http://666kb.com/i/c6st3ke4u4hqaem42.gif

By the way its HTML codes are like these at output;

<title>bu bahise gelen evet says tek say olacak</title><META NAME="Description" CONTENT="bu bahise 2 gün içerisinde gelen evet oyu sayısı tek sayı olacak. (ilkokullu editi: 2'nin katları çift sayıdır, 0 çift sayıdır)">

How can I solve this issue?

  • 写回答

3条回答 默认 最新

  • douwei8672 2012-08-29 13:32
    关注

    Make sure that you tell what character encoding the site uses. Without that, even if you correctly output the values in UTF-8 format, the consumer (in this case Facebook) will not know what encoding to use when reading your data.

    One way to do that is using this:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    

    In HTML5, you can also say:

    <meta charset="UTF-8" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭