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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user