diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
commit | 19985dbb8c0aa66dc4bf7905abc1148de909097d (patch) | |
tree | 2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /main/survey/sa_koda.php | |
download | 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip |
Diffstat (limited to '')
-rw-r--r-- | main/survey/sa_koda.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/main/survey/sa_koda.php b/main/survey/sa_koda.php new file mode 100644 index 0000000..b7d00b6 --- /dev/null +++ b/main/survey/sa_koda.php @@ -0,0 +1,45 @@ +<?php
+/***************************************
+ * Description:
+ * Autor: Robert Šmalc
+ * Created date: 15.04.2016
+ *****************************************/
+include_once('../../settings.php');
+include_once('../../function.php');
+
+if (!empty($_POST['koda'])) {
+ $koda = strtolower($_POST['koda']);
+
+ $sql = sisplet_query("SELECT url, anketa_id FROM srv_hierarhija_koda WHERE koda='" . $koda . "'");
+
+ if ($sql->num_rows > 0) {
+ $row = $sql->fetch_object();
+
+ //kodiramo spremenljivke z base64_encode
+ $url_encode_spremenljivke = urlencode(base64_encode($row->url));
+
+ //celotni url do ankete
+ header("Location: " . $site_url . "a/" . $row->anketa_id . "?enc=" . $url_encode_spremenljivke);
+ die();
+ }
+
+ // V kolikor gre za superšifro potem preverimo še med superšiframi
+ $sql = sisplet_query("SELECT koda, kode, anketa_id FROM srv_hierarhija_supersifra WHERE koda='" . $koda . "'");
+ if ($sql->num_rows > 0) {
+ $row = $sql->fetch_object();
+ $kode = unserialize($row->kode);
+
+ $koda_resevanje = sisplet_query("SELECT url FROM srv_hierarhija_koda WHERE koda='" . $kode[0] . "' AND anketa_id='" . $row->anketa_id . "'", "obj");
+
+ //kodiramo spremenljivke z base64_encode
+ $url_encode_spremenljivke = urlencode(base64_encode($koda_resevanje->url . '&supersifra=' . $koda.'&resujem=0'));
+
+ //celotni url do ankete
+ header("Location: " . $site_url . "a/" . $row->anketa_id . "?enc=" . $url_encode_spremenljivke);
+ die();
+ }
+
+}
+
+header("Location: " . $site_url);
+die();
|