Im trying create a form to connect a router mikrotik:
php code
<?php //ConectarAPI use PEAR2\Net\RouterOS; // require_once 'pear2\src\PEAR2\Autoload.php'; require_once 'PEAR2_Net_RouterOS-1.0.0b4.phar'; //Formulario echo "<table><form action='' method='POST'> <tr> <td><input type='text' value='". $ip ."' name='ip' /></td> <td><input type='text' value='". $username ."' name='ip' /></td> <td><input type='password' value='". $password ."' name='ip' /></td> <td><button type='submit' value='' name=''>Conectar</button></td></tr> </form></table> "; //CONEXION A MIKROTIK $client = new RouterOS\Client('$ip', '$username', '$password'); ?>
Its something like that, but i cant connect, and i have this alert: "Fatal error: Uncaught exception 'PEAR2\Net\Transmitter\SocketException' with message 'stream_socket_client(): php_network_getaddresses: getaddrinfo failed: No such host is known. ' in phar://C:/wamp/www/PEAR2_Net_RouterOS-1.0.0b4.phar/PEAR2_Net_RouterOS-1.0.0b4/src/PEAR2/Net/RouterOS/Communicator.php on line 151"
I think that API is triyng to connect without values :S
Thanks