PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/test/subjects/benchmarks/webapps/eveactive_1.0/server.php

http://phc.googlecode.com/
PHP | 36 lines | 25 code | 8 blank | 3 comment | 5 complexity | ede5562dec9b01d2e55d3e2c60d51d6c MD5 | raw file
Possible License(s): GPL-2.0, 0BSD, BSD-3-Clause, Unlicense, MPL-2.0-no-copyleft-exception, LGPL-2.1
  1. <?php
  2. // MY SQL Connection
  3. //error_reporting(E_ALL);
  4. ob_start();
  5. define('MYSQL_HOST', 'localhost');
  6. define('MYSQL_USER', 'membertrack');
  7. define('MYSQL_PASS', 'membertrack');
  8. define('MYSQL_DATABASE', 'membertrack');
  9. if(!@mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS)) {
  10. die();
  11. }
  12. if(!mysql_select_db(MYSQL_DATABASE)) {
  13. die();
  14. }
  15. function Check()
  16. {
  17. $returnValue = false;
  18. $pattern = "/^EVE-minibrowser.*\/([0-9]+\.[0-9]+).*$/";
  19. if (preg_match($pattern, $_SERVER['HTTP_USER_AGENT'], $matchs))
  20. if ($matchs[1] >= 2.0)
  21. $returnValue = true;
  22. if (!$returnValue){
  23. header("Location: URL");
  24. }
  25. // Access comes from External Browser, redirect to Forums
  26. return $returnValue;
  27. }
  28. ?>