Posted By

sb_01 on 10/10/10


Tagged

valid get php session post cookie validation


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

pytheas
bobbym245


ID of POST, GET, COOKIE or SESSION - Validation


 / Published in: PHP
 

  1. $id = abs(intval($id)); // only positiv and complete id's
  2.  
  3. if(!isset($id) or empty($id) or is_array($id)) {
  4. return false;
  5. }
  6.  
  7. $id = 3; // return true
  8. $id = [] // return false
  9. $id = '' // return false

Report this snippet  

You need to login to post a comment.