BioTorrents.de’s version of Gazelle
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.

add.php 444B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare(strict_types = 1);
  3. authorize();
  4. $FriendID = (int) $_GET['friendid'];
  5. Security::checkInt($FriendID);
  6. // Check if the user $FriendID exists
  7. $DB->prepared_query("
  8. SELECT 1
  9. FROM `users_main`
  10. WHERE `ID` = '$FriendID'
  11. ");
  12. if (!$DB->has_results()) {
  13. error(404);
  14. }
  15. $DB->prepared_query("
  16. INSERT IGNORE INTO `friends`
  17. (`UserID`, `FriendID`)
  18. VALUES
  19. ('$LoggedUser[ID]', '$FriendID')
  20. ");
  21. header('Location: friends.php');