php - if ($_server request_method == post ) don't work when form post
Get the solution ↓↓↓Solution:
PHP string comparisons are case sensitive. since you havemethod="post"
, you'll getpost
in$_SERVER['REQUEST_METHOD']
, andPOST == post
isfalse
:
php > var_dump('POST' == 'post');
bool(false)
Answer
Solution:
Maybe try echo you$_SERVER['REQUEST_METHOD']
variable before IF
ORvar_dump($_SERVER)
and check what's wrong in this array - maybe your server don't set a REQUEST_METHOD key
OR try:
if( count($_POST) ){/*....*/};
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: failed to create image decoder with message 'unimplemented'
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.