Php 如何不允许人们手动更改html表单代码并提交
所以我使用codeigniter,我已经制作了提交评论的表单Php 如何不允许人们手动更改html表单代码并提交,php,forms,security,codeigniter,Php,Forms,Security,Codeigniter,所以我使用codeigniter,我已经制作了提交评论的表单 echo form_open(current_url()); // http://localhost/post/26 $textarea = array( 'id' => 'comment_area', 'name' => 'comment', 'value' => set_value('comment'), 'cols' => 35, 'rows' => 5 );
echo form_open(current_url()); // http://localhost/post/26
$textarea = array(
'id' => 'comment_area',
'name' => 'comment',
'value' => set_value('comment'),
'cols' => 35,
'rows' => 5
);
echo form_textarea($textarea);
echo '<br />';
echo form_submit('submit', 'Comment');
echo form_close();
echo form_open(当前url());//http://localhost/post/26
$textarea=数组(
'id'=>'comment_area',
'名称'=>'注释',
'value'=>set_value('comment'),
“cols”=>35,
“行”=>5
);
回音表单_textarea($textarea);
回声“
”;
回送表格提交(“提交”、“评论”);
回声形式_close();
那么您如何猜测这一结果:
但问题是,当我使用firebug操作id手动更改为25时:
<form action="http://localhost/post/25" method="post" accept-charset="utf-8">
并提交->它将评论提交到第25篇文章,而不是第26篇。。。那么,我怎样才能像这样保护我的表单标签不受smth的攻击呢?如果我正确理解了你的问题,我会说,不要为这样的事情而烦恼。如果他们有许可,就让他们做吧 这里有一个小解释(场景)说明您可能不想这样做的原因。 假设根据您提供的内容,生成的键是30,因此您将有一个表单,如