From d9d53de693d6522be332f77d6ea3af8c8fa2c7b9 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Tue, 16 Sep 2025 17:11:16 +0000 Subject: [PATCH] chat --- admin.php | 22 +--------- assets/css/vibe.css | 9 +---- chat.php | 97 +++++++++++++++++++++++++++++++++++++++++++++ contact.php | 22 +--------- index.php | 22 +--------- sandbox.php | 72 ++++++++++++++++++++++++--------- seo.php | 22 +--------- vibe.php | 17 +------- 8 files changed, 157 insertions(+), 126 deletions(-) create mode 100644 chat.php diff --git a/admin.php b/admin.php index 1801d1f..82ccfb2 100644 --- a/admin.php +++ b/admin.php @@ -82,27 +82,7 @@ if ($is_logged_in && $pdo) { - +
diff --git a/assets/css/vibe.css b/assets/css/vibe.css index fb4aa84..ed88b23 100644 --- a/assets/css/vibe.css +++ b/assets/css/vibe.css @@ -1,8 +1 @@ - - @import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap"); - body { font-family: "Orbitron", sans-serif; background: linear-gradient(to bottom, #2c003e, #ff00c1); color: #fff; } - .navbar, .card, footer { background-color: rgba(0,0,0,0.5) !important; backdrop-filter: blur(10px); border: 1px solid #ff00c1; } - .navbar-brand, .nav-link, h1, h2, h5, p { color: #fff !important; text-shadow: 0 0 10px #ff00c1; } - .btn-primary { background: #ff00c1; border: none; box-shadow: 0 0 15px #ff00c1; } - .vibe-preview { padding: 2rem; border: 1px solid #ff00c1; margin-top: 2rem; } - \ No newline at end of file +body { font-family: "Arial", sans-serif; background-color: #f0f0f0; color: #000; } .navbar, .card, footer { background-color: #f0f0f0 !important; border: 2px solid #000; box-shadow: none !important; border-radius: 0; } .navbar-brand, .nav-link, h1, h2, h5, p { color: #000 !important; } .btn-primary { background-color: #FFFF00; color: #000; border: 2px solid #000; border-radius: 0; } .vibe-preview { padding: 2rem; border: 2px solid #000; margin-top: 2rem; } \ No newline at end of file diff --git a/chat.php b/chat.php new file mode 100644 index 0000000..8fcd81e --- /dev/null +++ b/chat.php @@ -0,0 +1,97 @@ + + + + + + Chat with Gemini + + + + + +
+
+
+ Chat with Gemini +
+
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+ + + + + diff --git a/contact.php b/contact.php index 846e126..fddaf22 100644 --- a/contact.php +++ b/contact.php @@ -40,27 +40,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { - +
diff --git a/index.php b/index.php index 358cd23..10dcb1a 100644 --- a/index.php +++ b/index.php @@ -11,27 +11,7 @@ - +
diff --git a/sandbox.php b/sandbox.php index 94bd14d..9789b3c 100644 --- a/sandbox.php +++ b/sandbox.php @@ -1,19 +1,55 @@ - + + + + + PHP Sandbox + + + + + +
+

PHP Sandbox

+

Write and execute PHP code in a sandboxed environment.

+
+
+ +
+ +
+
+ ["pipe", "r"], + 1 => ["pipe", "w"], + 2 => ["pipe", "w"] + ]; + $process = proc_open('php', $descriptorspec, $pipes); + if (is_resource($process)) { + fwrite($pipes[0], $code); + fclose($pipes[0]); + $output = stream_get_contents($pipes[1]); + fclose($pipes[1]); + $error = stream_get_contents($pipes[2]); + fclose($pipes[2]); + proc_close($process); + return $output ?: $error; + } + return 'Failed to create process.'; + } -function execute_php_code($code) { - // Ensure the code is wrapped in PHP tags - if (strpos(trim($code), ''; - } - - $descriptorspec = [ - 0 => ["pipe", "r"], // stdin - 1 => ["pipe", "w"], // stdout - 2 => ["pipe", "w"] // stderr - ]; - - $process = proc_open('php', $descriptorspec, $pipes); - - if (is_resource($process)) { - fwrite($pipes[0], $code); - fclose($pipes[0]); \ No newline at end of file + if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['code'])) { + $code = $_POST['code']; + $output = execute_php_code($code); + echo '

Output:

'; + echo '
' . htmlspecialchars($output) . '
'; + } + ?> +
+ + diff --git a/seo.php b/seo.php index 526c26f..0a11a80 100644 --- a/seo.php +++ b/seo.php @@ -103,27 +103,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['url'])) { - +
diff --git a/vibe.php b/vibe.php index dc3cdee..1d45f29 100644 --- a/vibe.php +++ b/vibe.php @@ -68,22 +68,7 @@ if ($pdo) { - +