elentz Posted April 9, 2007 Share Posted April 9, 2007 Can someone show me where or how to do this?? I need to connect to a server by TCP/IP on port 4000 usint a username and password. Once I get connected then the server will send me 1 line records that will be at random intervals. I want to send that info to a MySql server DB so I can use it later. I know just enough to be dangerous! Any help or guidance greatly appreciated! Thanks Ed Quote Link to comment Share on other sites More sharing options...
Glyde Posted April 9, 2007 Share Posted April 9, 2007 <?php $connectVars = array('host' => 'host to connect to', 'port' => 4000); $sockHandle = fsockopen($connectVars['host'], $connectVars['port']); // You'll have to use fwrite() here to send your username and password, since I don't know how that should be sent // Then you can use fread() to read information ?> Quote Link to comment Share on other sites More sharing options...
SiC_Goat Posted April 9, 2007 Share Posted April 9, 2007 I'm curious as to why you want to connect to port 4000 using TCP, as apposed to UDP. A quick google search told me TCP port 4000 is used by SkyDance, a backdoor program. Now I normally wouldn't look up something like this, but you say you know enough to be dangerous, and want to insert data that is sent at random intervals into a database... Anyhow, I really don't think PHP is the language to be using for something like this if I'm wrong about your intentions. Just because it has inherent MySQL functionality doesn't make it good to bridge databases with non-web based programs. Quote Link to comment Share on other sites More sharing options...
elentz Posted April 10, 2007 Author Share Posted April 10, 2007 Believe me that my intentions are honorable. I install telepnone systems, and some of the new ones use tcp port 4000 to output call information. I want to connect to that port and retrieve the call records. The record information will be a single line of text. I want to take that information and send it to a DB that I can set up a small web server to do reports on it. I can do the web server and the DB ,it is just the connecting and getting the info into the Db that is my sticking point. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.