Skip to content
PHP Logo

What is the best way to create a PHP terminal that accepts server, port, user, and password via GET?

To create a PHP terminal that accepts server, port, user, and password via GET, you can use a simple PHP script that retrieves the parameters from the GET request and uses them to establish a connection to the server. You can then execute commands or interact with the server using the provided credentials.

php
<?php
$server = $_GET['server'];
$port = $_GET['port'];
$user = $_GET['user'];
$password = $_GET['password'];

$connection = ssh2_connect($server, $port);
ssh2_auth_password($connection, $user, $password);

// Now you can execute commands or interact with the server using the established connection
?>