2015-08-25 21 views
0

我已存储在我的数据库XAMPP一些印地文和乌尔都语写有我设置utf8_unicode_ci和首先,我以前<title>标签写这行 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 在我的网页,然后我用这条线<meta charset="utf-8"/>替换UPER线。Uni-Code在数据库和界面上不能同时运行?

当我在'phpmyadmin'中插入值并在网页上显示这些值时,它显示?????网页上的问号,但在'phpmyadmin'中它显示出良好的单向代码书写。

然后我更新这些uni-code列通过我的网页更新这些值后,他们有很好的写在网页上的观点,但现在这一次在数据库列中显示آب Ùˆ Ûوا这些类型或章程。

现在我没有得到什么happning我纠正一方,另一方转变为'unicode-less'。

这是我的网页代码而我会使用PHP 5.6.11

<!doctype html> 
<html> 
<head> 
<link href="drop_down.css" rel="stylesheet" type="text/css" /> 
<link href="tooplate_style.css" rel="stylesheet" type="text/css" /> 

<meta charset="utf-8"/> 
<title>Main Page</title> 
</head> 
<body> 
<div> 
     <div align="right"> <form action="logout.php" method="post"> <input type="submit" value="Log Out" class="Lbtn" name="L_btn"> </form> </div> 
     <header align="center"><a href="index.html"> Talash -e- Haraf </a>  </header>  
      <nav align="center"> 
      <form action="" method="post"> 
       <input name="srch" type="text" class="searchbar" placeholder="Select language and type word here"> 
       <select name="drp_dwn" class="dropdown dropdown-select" onchange="location = this.options[this.selectedIndex].value;"> 
       <option>--Please Select--</option> 
       <option value="srch_ru.php">Roman</option> 
       <option value="srch_e.php">English</option> 
       </select> 
       <input name="btn" type="submit" class="button" value="Search"> 
      </form> 
      </nav>  
     <div align="right"> 
         <table class="responstable"> 
           <tr> 
            <th>Pos</th> 
            <th>Roman</th> 
            <th>Urdu</th> 
            <th>Significance</th> 
            <th>Hindi</th> 
            <th>English</th> 
            <th>Type</th> 
            <th>Action</th> 
           </tr> 
           <tr> 
            <?php 
             $db=mysqli_connect("localhost","root","","app"); 

             foreach($db->query('SELECT * FROM lafaz') as $obj) 
             { 
            ?> 
            <td> <?php echo $obj["pos"] ?></td> 
            <td> <?php echo $obj["roman"] ?></td> 
            <td> <?php echo $obj["urdu"] ?></td> 
            <td> <?php echo $obj["important"] ?></td> 
            <td> <?php echo $obj["hindi"] ?></td> 
            <td> <?php echo $obj["english"] ?></td> 
            <td> <?php echo $obj["type"] ?></td> 
     <td> <a href="detail.php?id=<?php echo $obj['id']; ?>"> <img title="View Detail" src="detail.png" width="40px" height="35px"/> </a> 
      <a href="edit.php?id=<?php echo $obj['id']; ?>"> <img title="Edit Item" src="edit.png" width="40px" height="35px"/> </a> 
      <a href="delete.php?id=<?php echo $obj['id']; ?>"> <img title="Delete Item" src="delete.png" width="40px" height="35px"/> </a> </td> 
           </tr> 
           <?php 
            } 
           ?> 
         </table> 
     </div> 

</div> 
</body> 
</html> 
+1

''标签是旧的...尝试新的'。 – Xufox

+0

这与任何操作系统有什么关系?重复的答案是操作系统不可知的,它关于PHP,MySQL,HTTP和HTML。你真的经历了[这里]列出的点(http://stackoverflow.com/a/279279/476)吗?如果是这样:更新你的问题与每个点的细节。 – deceze

+0

那么**关于**数据访问**的其他答案中的最大段落**怎么样?!显示一些代码! – deceze

回答

1

你基本上需要从数据库确保整个供应链的网络服务器所有的反应都使用UTF-8。你没有提供足够的信息来给出更具体的建议,但检查两件事:

A)你所有的文件(.php等)是UTF-8吗?您的文本编辑器或IDE应显示该信息,并允许您转换它们,如果没有。 B)HTML中的元标记并不是正确的选择。如果您的Web服务器配置不正确,它们只是一个后备。使用内置于浏览器中的开发人员工具(通常可通过F12访问,使用“网络”选项卡)检查服务器是否返回带有字符集的Content-Type标题,例如,

Content-Type: text/html; charset=utf-8 

如果线路

AddDefaultCharset utf-8 

不添加到您的Apache Web服务器配置(http.conf.htaccess)。

如果您需要更多帮助,您需要提供更多信息。

相关问题