キケッツ掲示板のリポジトリです. https://bbs.kekec.wiki
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

delete.php 1.1 KiB

1 year ago
1 year ago
1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. require "${_SERVER['DOCUMENT_ROOT']}/database.php";
  3. $mysqli = set_mysql ('miteruzo_bbs');
  4. $mysqli -> set_charset ('utf8');
  5. $thread = $_GET['thread'];
  6. $id = $_GET['id'];
  7. $pass = $_GET['pass'];
  8. if ($result = $mysqli -> query ("
  9. SELECT
  10. pass, image
  11. FROM
  12. responses
  13. WHERE
  14. (thread_id = {$_GET['thread']}) AND (response_id = {$_GET['id']})")):
  15. $row = $result -> fetch_assoc ();
  16. if ($_GET['pass'] == $row['pass']):
  17. $mysqli -> query ("
  18. UPDATE
  19. responses
  20. SET
  21. deleted = 1
  22. WHERE
  23. (thread_id = $thread) AND (response_id = $id)");
  24. echo "消しましたぁ!!<br /><br /><img style='border: solid 1px' src='/images/{$row['image']}' />";
  25. else:
  26. echo '残念.<br />削除用パスワードが違います.';
  27. endif;
  28. echo "<br /><br />5 秒後に元のページに戻ります.<br /><br /><a href='/?thread=$thread#$id'>戻らない場合はこちら</a><script>setTimeout (function () {window.location.href = `/?thread=$thread#$id`}, 5000)</script>";
  29. endif;