From f85bef658b83fccc86612aa1f8b9251ea99b03ee Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 30 Aug 2026 19:09:09 -0700 Subject: [PATCH] Restructure & change a lot of this --- .vscode/sftp.json | 12 +++++ config/captcha.php | 3 -- get.php | 11 +++++ incl/db.php | 15 ------ incl/util.php | 15 ++++++ webroot/index.php => index.php | 77 +++++++++++++++++++----------- upload.php | 52 ++++++++++++++++++++ webroot/upload.php | 87 ---------------------------------- 8 files changed, 140 insertions(+), 132 deletions(-) create mode 100644 .vscode/sftp.json delete mode 100644 config/captcha.php create mode 100644 get.php delete mode 100644 incl/db.php rename webroot/index.php => index.php (66%) create mode 100644 upload.php delete mode 100644 webroot/upload.php diff --git a/.vscode/sftp.json b/.vscode/sftp.json new file mode 100644 index 0000000..11de796 --- /dev/null +++ b/.vscode/sftp.json @@ -0,0 +1,12 @@ +{ + "name": "My Server", + "host": "192.168.68.100", + "protocol": "sftp", + "port": 22, + "username": "root", +"password": "9982", + "remotePath": "/var/www/nameacolor.lncvrt.xyz", + "uploadOnSave": true, + "useTempFile": false, + "openSsh": false +} diff --git a/config/captcha.php b/config/captcha.php deleted file mode 100644 index 14429aa..0000000 --- a/config/captcha.php +++ /dev/null @@ -1,3 +0,0 @@ -prepare("SELECT * FROM colors ORDER BY timestamp DESC"); +$stmt->execute(); +$result = $stmt->fetchAll(PDO::FETCH_ASSOC); + +echo json_encode($result); \ No newline at end of file diff --git a/incl/db.php b/incl/db.php deleted file mode 100644 index 469c0df..0000000 --- a/incl/db.php +++ /dev/null @@ -1,15 +0,0 @@ - PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - ]; - $conn = new PDO($dsn, $dbusername, $dbpass, $options); - } catch (PDOException $e) { - die("Failed to connect to database: " . $e->getMessage()); - } - return $conn; -} \ No newline at end of file diff --git a/incl/util.php b/incl/util.php index 090531b..f98d271 100644 --- a/incl/util.php +++ b/incl/util.php @@ -1,4 +1,19 @@ PDO::ERRMODE_EXCEPTION, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + ]; + $conn = new PDO($dsn, $dbusername, $dbpass, $options); + } catch (PDOException $e) { + die("Failed to connect to database: " . $e->getMessage()); + } + return $conn; } \ No newline at end of file diff --git a/webroot/index.php b/index.php similarity index 66% rename from webroot/index.php rename to index.php index 9b78873..347103e 100644 --- a/webroot/index.php +++ b/index.php @@ -1,7 +1,5 @@ fetchAll(PDO::FETCH_ASSOC); $total = 255 * 255 * 255; $named = count($result); $remaining = $total - $named; - -$lastInsertId = $_GET['highlight'] ?? null; ?> @@ -25,7 +21,6 @@ $lastInsertId = $_GET['highlight'] ?? null; -