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[1]]);
$row = $req->fetch();
if (isset($row["original"])) {
http_response_code(301);
header("Location: " . $row["original"]);
} else {
http_response_code(404);
$pagename =
"The shortened link you wish to access does not exist or no longer exists";
include_once $_SERVER["DOCUMENT_ROOT"] . "/assets/includes/header.php";
?>
__("Oh no..."); ?>
__(
"The shortened link you wish to access does not exist or no longer exists."
); ?>
__("Return to the homepage"); ?>
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 deleteId = ?");
$req->execute([$argument[2]]);
$row = $req->fetch();
if (isset($row["deleteId"])) {
$req = $pdo->prepare(
"delete from " . $mysql_table . " where deleteId = ?"
);
$req->execute([$argument[2]]);
$pagename = "Shortened link deleted";
include_once $_SERVER["DOCUMENT_ROOT"] . "/assets/includes/header.php";
?>
__("Your shortened link has been deleted"); ?>
__("Thank you for your trust."); ?>
__("Return to the homepage"); ?>
__("Oh no..."); ?>
__(
"This deletion link does not exist."
); ?>
__(
"Therefore, the deletion of the shortened link cannot be processed."
); ?>
__("Return to the homepage"); ?>
__(
"Welcome to collabore link"
); ?>
__("Shorten all the links you want, efficiently, without any fuss."); ?>