Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

telnet through PHP?

Status
Not open for further replies.

monkle

Programmer
Feb 11, 2004
132
US
Summary: I have to find a way to automate connecting to a remote server (probably through telnet) and sending a series of commands.

Detail: We are currently using a remote database server and a local database server. We are going to consolidate everything locally, but to speed the process up we want to automate keeping the databases in sync.

To update the remote database, we have to first upload a file and then log in via a SCO/ANSI terminal and send a series of commands to tell the server to process the file that we uploaded.

I have finished the part of the script that assembles the file and uploads it to the remote server. At this point I am trying to figure out how to send the command to process that file. I think that if I could figure out how to make a telnet connection through PHP I could figure out the raw data to send, but I'm not sure. I don't even know if it's possible to create a telnet connection through PHP.

So, is it possible to create a telnet connection through php? Is there a better way to handle this? I've looked for existing classes, but can find nothing relating to it. Any advice would be greatly appreciated. I don't care how hack this solution is, we're only going to be running it for a couple months, maximum.

Any advice or input would be greatly appreciated. Thank you in advance.
 
yes you can. see the user notes in php.net. they contain a link to a prebuild telnet class.

php.net/manual/en/function.fsockopen.php
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top