Просмотр файла katrinka.ru/admin/chat_del.php

Размер файла: 594B
  1. <?php
  2. include '../wap/config.php';
  3. if (!($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass"))) {
  4. echo ("пЫЙВЛБ РПДЛМАЮЕОЙС Л вд!\n");
  5. };
  6. pg_query($conn,"begin;");
  7. $res=pg_query($conn,"select fr_u from chat where id='$id';");
  8. $uid=pg_result($res,0,0);
  9. pg_query($conn,"update users set posts=(select posts from users where id='$uid')-1 where id='$uid';");
  10. pg_query($conn,"delete from chat where id='$id';");
  11. pg_query($conn,"end;");
  12. pg_close($conn);
  13. $link=sprintf("Location: chat.php?action=main&r=%s", $r);
  14. header($link);
  15. ?>