Jump to content

I know what I want just not how to do it.


elentz

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/46349-i-know-what-i-want-just-not-how-to-do-it/
Share on other sites

<?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
?>

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.

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.

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.