+ 1
Why we use this method in web develop!!
<?php if($_SERVER['REQUEST_METHOD']=='POST'){ // php code here } ?> we use it to stop php code run when Web page is loading because auto run cause problems when connecting to data base and we can run it when click the `submit` button
1 Antwort
0
$_SERVER['REQUEST_METHOD']
contains the request method. It is used to check request method.This variable also says if the request is a 'GET', 'HEAD', 'POST' or 'PUT' request.