Posted By

iloveitaly on 08/29/09


Tagged

get php key unique hash cache var kohana


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


Generate Unique Key Based on GET Vars


 / Published in: PHP
 

Using the kohana framework for XSS protection

  1. $get = input::instance()->get();
  2.  
  3. if(empty($get)) {
  4. $cacheKey = 'empty';
  5. } else {
  6. asort($get);
  7. $queryString = http_build_query($get);
  8. $cacheKey = md5($queryString);
  9. }

Report this snippet  

You need to login to post a comment.