html - Php echo not working on empty form field test -


i'm finding echo isn't working in scripts. stripped down script below i've been using debug this, result has been same.

perhaps can see simple i've overlooked. appreciated.

additional details:

(i'm wanting check field not empty before submitting database, , provide prompts or echo on submit.)

<?php if($_server['request_method'] == 'post'){     if(!isset($fielda)){         echo "error: submission field empty.";     }     else{         echo "success! submitted field wasn't empty.";     } } ?>  <h1> example title </h1> <form method="post" action="sandbox.php" >     <input type="text" name="fielda" value="" />     <br />     <input type="submit" name="submit" /> </form> 

if($_server['request_method'] == 'post'){ .......... } 

try one. or change if condition like,

 if(!isset($_post['fielda'])){      if(empty($_post['fielda'])) {          echo "error: submission field empty.";      }         }         else{             echo "success! submitted field wasn't empty.";         } 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -