Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
FROM php:7.4.21-apache
|
FROM php:7.4.21-apache
|
||||||
ARG APP_VERSION=v1.0.5
|
ARG APP_VERSION=v1.0.6
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends less nano tini curl tar git zip unzip && \
|
apt-get install -y --no-install-recommends less nano tini curl tar git zip unzip && \
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if(is_string($docker_cid)) {
|
|||||||
define('DATABASE_PREFIX', Getenv('DATABASE_PREFIX'));
|
define('DATABASE_PREFIX', Getenv('DATABASE_PREFIX'));
|
||||||
define('DATABASE_CHARSET', Getenv('DATABASE_CHARSET'));
|
define('DATABASE_CHARSET', Getenv('DATABASE_CHARSET'));
|
||||||
} else {
|
} else {
|
||||||
define('DATABASE_HOST', "localhost");
|
define('DATABASE_HOST', "mariadb");
|
||||||
define('DATABASE_PORT', "3306");
|
define('DATABASE_PORT', "3306");
|
||||||
define('DATABASE_NAME', "qrcode");
|
define('DATABASE_NAME', "qrcode");
|
||||||
define('DATABASE_USER', "root");
|
define('DATABASE_USER', "root");
|
||||||
|
|||||||
@@ -11,14 +11,16 @@
|
|||||||
|
|
||||||
include 'qrcode/config/config.php';
|
include 'qrcode/config/config.php';
|
||||||
|
|
||||||
|
$prefix = DATABASE_PREFIX;
|
||||||
|
|
||||||
//Get DB instance. function is defined in config.php
|
//Get DB instance. function is defined in config.php
|
||||||
$db = getDbInstance();
|
$db = getDbInstance();
|
||||||
$get_id = htmlspecialchars($_GET['id'], ENT_QUOTES, 'UTF-8'); // I take the id through the GET method
|
$get_id = htmlspecialchars($_GET['id'], ENT_QUOTES, 'UTF-8'); // I take the id through the GET method
|
||||||
|
|
||||||
$state = $db->query("SELECT state FROM dynamic_qrcodes WHERE identifier='$get_id'");
|
$state = $db->query("SELECT state FROM " . $prefix . "dynamic_qrcodes WHERE identifier='$get_id'");
|
||||||
$link = $db->query("SELECT link FROM dynamic_qrcodes WHERE identifier='$get_id'");
|
$link = $db->query("SELECT link FROM " . $prefix . "dynamic_qrcodes WHERE identifier='$get_id'");
|
||||||
|
|
||||||
$update = $db->query("UPDATE dynamic_qrcodes SET scan=scan+1 WHERE identifier='$get_id'");
|
$update = $db->query("UPDATE " . $prefix . "dynamic_qrcodes SET scan=scan+1 WHERE identifier='$get_id'");
|
||||||
|
|
||||||
if($state[0]['state'] == 'enable'){
|
if($state[0]['state'] == 'enable'){
|
||||||
echo '<meta http-equiv="refresh" content="0; URL='.$link[0]['link'].'" />'; // Page refresh with the link obtained
|
echo '<meta http-equiv="refresh" content="0; URL='.$link[0]['link'].'" />'; // Page refresh with the link obtained
|
||||||
|
|||||||
Reference in New Issue
Block a user