+ 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 Answer
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