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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.