PHP Form Validation on Server-side -


i have php form , need 4 field data submitted.

  1. name
  2. email
  3. password
  4. mobile

now have check if above data available or not.

for debugging purpose use $_get below

if (!empty($_get['name']) or !empty($_get['email']) or !empty($_get['password']) or !empty($_get['mobile'])) {     $response = array(         'status' => 'ok',         'error' => '1',         'message' => 'registered successfully. please check email activation details',         'data' => ''); } else {     $response = array(         'status' => 'nok',         'error' => '1',         'message' => 'there error please try again.',         'data' => ''); } 

the above not able validate form properly.

it important use and in condition, not or:

if (!empty($_get['name']) , !empty($_get['email']) , !empty($_get['password']) , !empty($_get['mobile'])) { 

Comments