Telnet via PHP?

Hello everyone

I need to control my receiver via a PHP script. For this, I need to use the Telnet protocol.

For this I found a great script on github which already creates a class and the function.

Could someone show me what the sequence connection, write, read, disconnect looks like using an example???

Each command is a string followed by a line end (CRLF)

For example, I want to send the command "17FN".

IP address would be 10.0.0.0.155

port: 8102 TCP

Thank you.

here is the script:

https://github.com/ngharo/Random-PHP…lnet.class.php

Thank you!

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
guteantwort626
1 year ago

It’s a shame there’s no docue, but I’d suspect it’s like this:

connect()){
    $result = $conn->exec('17FN');
    echo $result;
} else {
    die('Fehler!');
}
ntechde
1 year ago

Well, someone wrote a class and didn’t document it. Either you’re looking for a Telnet client that’s better documented, or you’re working in the code and trying to understand what’s happening.

Actually, no rocket science and highly educational at the top. But I need a good half an hour and I don’t have them.