PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]; try { $pdo = new PDO($dsn, $mysql_username, $mysql_password, $options); $pdo->exec("use " . $mysql_db); } catch (PDOException $e) { die($e->getMessage() . " " . (int) $e->getCode()); } $req = $pdo->prepare("select * from " . $mysql_table . " where id = ?"); $req->execute([$argument]); $row = $req->fetch(); if (isset($row["id"])) { $deletionId = $row["deleteId"]; $origin = $row["original"]; include_once $_SERVER["DOCUMENT_ROOT"] . "/assets/includes/header.php"; $to_email = "abuse@$url"; $subject = "Report of a link from $name ($argument → $origin)"; $message = "Hello,\n\nThe shortened link https://$url/$argument was reported by a user of the $name link shortener.\nIt targets the link $origin.\nIts deletion link is https://$url/d/$deletionId.\nPlease check whether or not this link complies with $name's terms of use.\n\nCordially,\nThe $name reporting page."; $headers = "From: no-reply@$url\n"; $headers .= "Content-type: text/plain; charset=utf-8\n"; mail($to_email, $subject, $message, $headers); $pagename = "Report sent"; ?>

__("Thank you for your report"); ?>

__( "We will take care of your report as soon as possible" ); ?>

__("Return to the homepage"); ?>

__("Oh no..."); ?>

__( "The identifier of the link you wish to report does not exist." ); ?>
__( "Therefore, the report cannot be processed." ); ?>

__("Return to the reporting page"); ?>