Jump to content

PHP telnet


island

Recommended Posts

Hi,

 

I need to run a command in a distant unix server from a windows server using the telnet in php

 

when i run this code :

 

$server = '10.0.0.1'; 
$port = 23; 
$fp = fsockopen($server, $port);
if(!$fp) {
echo = 'connexion NOK';
}

fwrite($fp, "user\r\n");
fwrite($fp, "password\r\n");
fwrite($fp, "mkdir toto\r\n");

 

it return no error message, but when i verify in the server, the directory "toto" is not created !

 

Can you please help me ? thank you.

 

Link to comment
https://forums.phpfreaks.com/topic/144137-php-telnet/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.