Просмотр файла _X_admin_X_/index.php

Размер файла: 2.21Kb
  1. <?php
  2. error_reporting(0);
  3. include '../connect.php';
  4. include '../functions.php';
  5. include '../config.php';
  6. header("Content-type: text/html; charset=utf-8");
  7. header("Cache-Control: no-cache");
  8. $path=$_SERVER['PHP_SELF'];
  9. $folder=dirname($path);
  10. if (!isset($_GET['password']) and !isset($_GET['p']))
  11. {echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  12. <html><head><title>Admin</title></head>
  13. <form method="get" action="?">
  14. <input type="password" name="password"><br/>
  15. <input type="hidden" name="get" value="1">
  16. <input type="submit" value="Вход">
  17. </form></html>';
  18. exit();}
  19. if (isset($_GET['get']))
  20. {
  21. $get_pass=md5(trim($_GET['password']));
  22. if ($get_pass==$pass){echo '<a href="?p=0&amp;password='.$get_pass.'">Вход</a>';}
  23. else {echo 'error';}
  24. exit();
  25. }
  26. $p=$_GET['p'];
  27. if ($_GET['password']<>$pass){echo 'err'; exit();}
  28.  
  29. switch ($p)
  30. {
  31. case '0':
  32. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  33. <html><head><title>Админ панель</title>
  34. '.$css.'
  35. </head>
  36. <div class="zag" align="center">Админ панель</div>
  37. <div class="c">
  38. <a href="?p=1&amp;password='.$_GET['password'].'&amp;pp=0">Управление категориями</a><br/>
  39. <a href="?p=2&amp;password='.$_GET['password'].'">Опубликовать файлы</a><br/>
  40. <a href="?p=3&amp;password='.$_GET['password'].'">Управление файлами</a><br/>
  41. <a href="'.str_replace('_X_admin_X_','',$folder).'?password='.$_GET['password'].'">Описание файлов</a><br/>
  42. </div>
  43. <div class="kon" align="center"><a href="'.str_replace('/_X_admin_X_','',$folder).'/">В ZC</a></div>
  44. </html>';
  45. break;
  46. ///---------------------------------------------///
  47. case '1':
  48. include $_SERVER['DOCUMENT_ROOT'].$folder.'/pages/1.php';
  49. break;
  50. ///---------------------------------------------///
  51. case '2':
  52. include $_SERVER['DOCUMENT_ROOT'].$folder.'/pages/2.php';
  53. break;
  54. ///---------------------------------------------///
  55. case '3':
  56. include $_SERVER['DOCUMENT_ROOT'].$folder.'/pages/3.php';
  57. break;
  58. ///---------------------------------------------///
  59. case '4':
  60. include $_SERVER['DOCUMENT_ROOT'].$folder.'/pages/4.php';
  61. break;
  62. ///---------------------------------------------///
  63. }
  64. ?>