Просмотр файла gname.php

Размер файла: 681B
  1. <?php
  2. include 'inc/db.php';
  3. include 'inc/1.php';
  4. if ($user['id']!=1){
  5. header("Location: /index.php");
  6. exit;
  7. }
  8. if (!$_GET['id']){
  9. header("Location: /index.php");
  10. exit;
  11. }
  12. if (!$_POST['name']){
  13. echo "<div class='input'><form method='POST' action='?id=".intval($_GET['id'])."'>Имя должности:<br><input type='text' name='name'><br><input type='submit' value='Назначить'></font></div>";
  14. }
  15. else
  16. {
  17. $name=mysql_real_escape_string($_POST['name']);
  18. mysql_query("UPDATE `user` SET `moder` = '1', `gname` = '$name' WHERE `id` = '".intval($_GET['id'])."'");
  19. header("Location: /ank.php?id=".intval($_GET['id']));
  20. }
  21. include_once 'inc/foot.php';
  22. ?>
  23.  
  24.  
  25.