Просмотр файла modules/share/add_dir.php

Размер файла: 1.18Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_share';
  9. if($user['level'] < '6') { go('/'); }
  10. if(isset($_POST['create']) && $_GET['act'] == 'create') {
  11. $name = substr(input($_POST['name']), 0, 90);
  12. $desc = substr(input($_POST['desc']), 0, 200);
  13. $db->query("INSERT INTO `share`(`name`, `desc`) VALUES('".$name."', '$desc')");
  14. // print_r($db->errorInfo());
  15. go('/share/');
  16. }
  17. $title = $lang->word('create_dir');
  18. require_once(SYS.'/view/header.php');
  19. $tpl->div('title', $lang->word('create_dir'));
  20. echo '<form action="/share/add_dir/?act=create" method="post">
  21. <div class="menu">
  22. <b>'. $lang->word('name') .'</b>:<br/>
  23. <input name="name" type="text" /><br/>
  24. <b>'. $lang->word('desc') .'</b>:<br/>
  25. <input name="desc" type="text" /><br/>
  26. <input name="create" type="submit" value="'. $lang->word('create') .'" /><br/>
  27. </div>
  28. </form>';
  29. $tpl->div('block', NAV .'<a href="/share/">'. $lang->word('share') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
  30. require_once(SYS.'/view/footer.php');
  31. ?>