Jump to content

need help trying to connect to telnet?


mattonline

Recommended Posts

i've been trying to work this out....

code below

 

<?

$domain = 'internet.co.uk';

$fs = fsockopen('whois.nic.uk', 43, $errno, $errstr, 60);

if (!$fs) {

  fclose($fs);

} else {

 

fputs($fs, "$domain\r\n");

$line = fgets($fs, 1024);

echo $line;

}

?>

 

 

i want to input a domain and then for it to open the telnet and send the domain to the telnet...

 

is this correct?

 

<?php

$domain = 'internet.co.uk';

$sourceip = 'xx.xx.xx.xx'; // ip you want to bind to

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

socket_bind($sock, $sourceip);

socket_connect($sock, 'dac.nic.uk', 2043);

// Write

$request = "$domain\r\n";

socket_write($sock, $request);

//Read reply

// Close

socket_close($sock);

?>

 

 

sorry this is then the created socket....

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.