Generate Unique Key Based on GET Vars


/ Published in: PHP
Save to your folder(s)

Using the kohana framework for XSS protection


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.