MODx referer authentication snippet


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

For low level authentication only.


Copy this code and paste it in your HTML
  1. <?php
  2. $referer = $_SERVER['HTTP_REFERER'];
  3. $referer_parse = parse_url($referer);
  4.  
  5. if($referer_parse['host'] == "site.com" || $referer_parse['host'] == "www.site.com") {
  6. // download...
  7. $chunk = $modx->getChunk("displayChunk");
  8. echo $chunk;
  9. } else {
  10. //header("Location: http://www.mysite.com");
  11. //$modx->sendRedirect();
  12. echo $modx->getChunk("noAccess");
  13. //exit();
  14. }
  15. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.