forked from hanlintao/translatorscanprogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path代码 6-17.php
More file actions
50 lines (50 loc) · 1.69 KB
/
代码 6-17.php
File metadata and controls
50 lines (50 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php include "shared/head.php"; ?>
<table width="100%" border="1">
<tbody>
<tr>
<td width="10%">
<p><strong>序号</strong></p>
</td>
<td width="45%">
<p><strong>中文</strong></p>
</td>
<td width="45%">
<p><strong>英文</strong></p>
</td>
</tr>
<?php include "shared/conn.php"; ?>
<?php
mysqli_select_db( $conn,"fmprc" );
$zh_CN =$_POST["zh_CN"];
$en_US =$_POST["en_US"];
$sql = "SELECT ID, zh_CN, en_US FROM tm WHERE zh_CN LIKE '%$zh_CN%' AND en_US LIKE '%$en_US%'";
mysqli_query($conn,"set names 'utf8'");
$gettm = mysqli_query($conn,$sql);
if(! $gettm )
{
echo "无法获取翻译记忆,请检查问题";
}
else
{
while ($row = mysqli_fetch_array($gettm, MYSQLI_ASSOC))
{
$row["zh_CN"]=preg_replace("/$zh_CN/i", "<font color=blue><b>$zh_CN</b></font>",$row["zh_CN"]);
$row["en_US"]=preg_replace("/$en_US/i", "<font color=red><b>$en_US</b></font>",$row["en_US"]);
echo "<tr>
<td width='10%'>
<p>{$row["ID"]}</p>
</td>
<td width='45%'>
<p>{$row["zh_CN"]}</p>
</td>
<td width='45%'>
<p>{$row["en_US"]}</p>
</td>
</tr>";
}
}
mysqli_close($conn);
?>
</tbody>
</table>
<?php include "shared/foot.php"; ?>