Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
08-03-2007, 06:22 PM #1
- Join Date
- Aug 2007
- Thanked 0 Times in 0 Posts
Getting PHP to interact with Telnet session
I am trying to get php to dynamically interact with a telnet session, so that it will connect, get header output, execute a command, return the results, and then end the session.
For example, I might want to get it to execute:
"telnet $host 110"
"user $username" "pass $password" "list" "quit"
1. How do I get output from a telnet session?
2. How do I send from additional commands after the session was open and return the outs from those?
I am currently working with PHP Version 5.1.6 running on Apache/2.2.2, Fedora Core 5.
08-04-2007, 02:47 AM #2
- Join Date
- May 2002
- Perth Australia
- Thanked 92 Times in 90 Posts
telnet requires a challenge-response process so you need to write a daemon that will send data to and listen for data from the telnet server, in other words you need to write your own socket server.
Might be easier to start off with one already written,
I have no knowledge of this script BTW its just the first one that google gave me..resistance is...
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)