0
我正在使用以下代碼,從phpmyadmin中的數據庫獲取數據,並在html表中顯示它。在消息欄中,我放置了一個視圖鏈接,以便在單擊時顯示完整消息。我已成功截斷消息。現在View Link的onclick事件不起作用。請參閱如果我做某事錯:應用視圖鏈接
<?php $i=0;?>
<table border="1" style="position:absolute; left: 197px; top: 50px;">
<tr>
<td width="236" style="font-family:Ravie; color:#313253; text-align:center">Name</td>
<td width="225" style="font-family:Ravie; color:#313253; text-align:center">
Email Address</td>
<td width="267" style="font-family:Ravie; color:#313253;
text-align:center">Message</td>
</tr>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"FullName");
$f2=mysql_result($result,$i,"EmailAddr");
$string=mysql_result($result,$i,"Message");
$limit=10;
$string1 = myTruncate($string,$limit);
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $string1; ?></font>
<a href="" onclick="<?php echo $string; ?>">View</a></td>
</tr>
<?php
$i++;
}
?>
</table>