added login requirement to view articles to protect against potential data scrapping, with redirect functionality to the article the user attempts to view prior to login.

This commit is contained in:
2025-04-12 13:40:51 -06:00
parent f4dfaba1c6
commit 8d78a7d182
11 changed files with 102 additions and 195 deletions
+13
View File
@@ -22,6 +22,19 @@ if ($_SERVER['HTTP_HOST'] == 'localhost') {
define('DB', 'vintagecoding');
}
function exec_stmt($stmt, $param_types, ...$args)
{
$conn = get_connection();
$stmt = $conn->prepare($stmt);
$stmt->bind_param($param_types, ...$args);
$stmt->execute();
$result = $stmt->get_result();
if ($result)
return $result;
else
return mysqli_insert_id($conn);
}
function get_connection()
{
$conn = new mysqli(HOST, USER, PASS, DB);