我试图从用户那里得到评论,但浏览器显示致命错误:函数名称必须是字符串.我的代码;
// <form name="form1" method="post" action="posting.php">
// <input name="comment" type="text" id="comment" style="width:254px; height:44px;">
// </form>
<?php
$comment = $_POST('comment');//this was the line where problem occured
if(!empty($comment))
{
mysql_query("INSERT INTO comment (comment) VALUES('".$comment."')");
}
echo "$comment";
?>
Run Code Online (Sandbox Code Playgroud)
Ada*_*ght 10
使用括号执行数组解引用:[和].所以....
$comment = $_POST['comment'];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9992 次 |
| 最近记录: |