+
+
+
+
+
+
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') {
-
+
+
+
+ Chat with Gemini
+
+
+
+
+
+
+
+
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
+
+
+
+
+
+
+
+ ["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 '
+
+
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'])) {
-
+
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/vibe.php b/vibe.php
index dc3cdee..1d45f29 100644
--- a/vibe.php
+++ b/vibe.php
@@ -68,22 +68,7 @@ if ($pdo) {
-
+