...and it does indeed bring up the Password: prompt. However, I can't get it to parse the password I send to it (see above). I've tried \r's and \n's at the end of the line and combinations thereof. fputs() gives the number of characters written if successful, and it does indeed spit back '3' at me, as expected. VLC's telnet interface doesn't seem to want to take it though. Any thoughts?$pw = 'ece';
$fp = fsockopen("128.220.81.237", 80, $errno, $errstr, 10);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: 128.220.81.237\r\n";
$out .= "\r\n";
fputs($fp, $out);
$i = 0; // Placeholder that helps the script along.
echo fgets($fp, 128); // Pasword prompt shows up here.
echo fputs($fp, "ece"); // Send the password.
echo fgets($fp, 128); // Returns wrong password from here on out
echo fputs($fp, $pw);
echo fgets($fp, 128);
fclose($fp);
:DI'm close, very close. I open the connection as follows:
...and it does indeed bring up the Password: prompt. However, I can't get it to parse the password I send to it (see above). I've tried \r's and \n's at the end of the line and combinations thereof. fputs() gives the number of characters written if successful, and it does indeed spit back '3' at me, as expected. VLC's telnet interface doesn't seem to want to take it though. Any thoughts?$pw = 'ece';
$fp = fsockopen("128.220.81.237", 80, $errno, $errstr, 10);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: 128.220.81.237\r\n";
$out .= "\r\n";
fputs($fp, $out);
$i = 0; // Placeholder that helps the script along.
echo fgets($fp, 128); // Pasword prompt shows up here.
echo fputs($fp, "ece"); // Send the password.
echo fgets($fp, 128); // Returns wrong password from here on out :-(
echo fputs($fp, $pw);
echo fgets($fp, 128);
fclose($fp);
Users browsing this forum: No registered users and 19 guests