php - prevent direct access to form post function in codeigniter -
i using codeigniter create web application. problem having function submitting form. want prevent direct access url using function in form, if copy action method form , enter access url, deny access.
please guide me through this.
thanks you.
strictly speaking, doing if($_post) or if($this->input->post()) work in 90% of cases, aren't 100% correct. why not? well, if have post person has triggered form without filling out, still post.
if want make sure posting controller, need check request_method.
if($_server['request_method'] === 'post') { // post } else { show_404('not-a-post!'); } all of said, there very few times when limiting post best option. realistically should handling get , post gracefully.
Comments
Post a Comment