以下是我目前正在使用的代码:
$form = "
<form action='echo htmlentities($_SERVER["PHP_SELF"]);' method='post'>
<table>
<tr>
<td>Username</td>
</td><input type='text' name='user' value='$getuser' /></td>
</tr>
</table>
</form>";
?>
上面的代码给了我这个错误:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in ... on line 27
如果我将 this: 更改["PHP_SELF"]
为 this ['PHP_SELF']
,则会收到此错误:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in ... on line 27
如何修复上面的表单操作,使其停止返回解析错误?