我知道我应该对所有表单文本输入字段使用htmlentities但这不起作用:
<?php
echo "<tr>
<td align=\"right\">".Telephone." :</td>
<td><input type=\"text\" name=\"telephone\" size=\"27\"
value=\"htmlentities($row[telephone])\"> Inc. dialing codes
</td>
</tr>";
?>
它只是在表格中将输入值显示为“htmlentities(0123456789)”?我做错了什么?
发布于 2019-04-18 08:24:33
尝试使用
value=\"" . htmlentities($row[telephone]) . "\"
目前,您的字符串只包含htmlentities字符串并将变量拼接在其中。您需要输出字符串,调用函数并将其结果放置到位,如上所述。
发布于 2019-04-18 09:49:52
<?php echo '<tr>
<td align="right">' . Telephone . ' :</td>
<td><input type="text" name="telephone" size="27" value="' . htmlentities($row[telephone]) . '" /> Inc. dialing codes</td>
</tr>';
https://stackoverflow.com/questions/-100001125
复制相似问题