Skip to content

Instantly share code, notes, and snippets.

@Wohaho
Created May 3, 2018 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wohaho/c0aadc187fe8f6eba57ede676ae8980d to your computer and use it in GitHub Desktop.
Save Wohaho/c0aadc187fe8f6eba57ede676ae8980d to your computer and use it in GitHub Desktop.
<?php
if(isset($_POST['inputCommand'])){
$command = $_POST['inputCommand'];
if($command == null) die("Please write a comm");
$host = "217.182.41.72";
$password = "456789asd";
$port = 9876;
require_once("WebsenderAPI.php"); // Load Library
$wsr = new WebsenderAPI($host,$password,$port); // HOST , PASSWORD , PORT
if($wsr->connect()){ //Open Connect
$wsr->sendCommand($command /* "эnputCommand" here! */);
}else{
die("Connection error! Check ip, pass and port.");
}
$wsr->disconnect(); //Close connection.
}
?>
<center>
<br><br><br>
<form method="POST">
<input type="text" name="inputCommand" placeholder="Write a command!">
<input type="submit" value="Send!">
</form>
</center>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment