+ 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

29th Aug 2017, 6:23 AM
‎ضياء البشري محمد الحسن‎
‎ضياء البشري محمد الحسن‎ - avatar
1 Odpowiedź
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.
29th Aug 2017, 7:02 PM
Magdy Aboelmagd
Magdy Aboelmagd - avatar