Get PHP Telnet & 3 More
Web Scripts Free

Join the White Hat Crew mailing list and get four free scripts for your website!
  1. PHP Telnet: run telnet sessions from PHP scripts
  2. AffiliCloak: affiliate link cloaker
  3. Captcher: PHP powered captcha generator
  4. List Mailer GT: viral list building service mailer
Just enter your first name and email address below to download your free scripts today.

I'll never reveal your email address, and you can unsubscribe at any time

PHP Telnet 1.1

Run telnet sessions from within PHP scripts

Requirements | Security | Usage Examples

Requirements:


PHP Telnet requires PHP version 4.3 or higher, with support for fsockopen enabled.

Security:


I strongly recommend that you do not store your username and password in a PHP script unless only people you trust completely have access to your server. Instead, use a form to enter the username and password each time the script is run. Exercise caution with any system that transmits passwords over unencrypted connections.

 Newsfeeds aggregated and converted to HTML by CaRP and scrolled by Tetra
Phone ringtones a "public performance"? EFF, AT&T say no
Jul 2@6:49pm: It isn't often that you find AT&T and the Electronic Frontier Foundation in agreement, but consensus has been reached on one matter: ASCAP's demand that wireless companies pay it license fees for ringtones is, well, ridiculous.On Wednesday EFF ca... [from Ars Technica]
Microsoft Changing Users' Default Search Engine
Jul 2@5:34pm: BabyDuckHat writes "Cnet's Dennis O'Reilly caught "Windows Search Helper" trying to change his default Firefox search from Google to Bing. This isn't the first time the software company has been caught quietly changing user's preferences to benefi... [from Slashdot]
DOJ Confirms Google Antitrust Investigation
Jul 2@4:42pm: An anonymous reader points to Digital Daily, writing "Looks like the fireworks have begun early in Mountain View. On Thursday afternoon, the Department of Justice officially notified Google that it is investigating its book deal for violations of ... [from Slashdot]
"MySpace mom" Lori Drew's conviction thrown out
Jul 2@3:31pm: "MySpace mom" Lori Drew has had her misdemeanor guilty verdict overturned by the federal judge handling the case, the LA Times reports. Violating a website's terms of use is not, it seems, a federal crime after all. Horrible things aren't always ... [from Ars Technica]
Dish Network DVR Features Get Stay of Execution
Jul 2@12:30pm: The final day of reckoning in the four-year battle between TiVo and EchoStar has been pushed out a little further. Late Wednesday evening, the U.S. Court of Appeals for the Federal Circuit granted EchoStar's request to stay a contempt order impose... [from E-Commerce Times]
Large Tech Firms: Beware of Obama Administration's Antitrust Plans
Jul 2@5:00am: In a dramatic repudiation of Bush administration policies, the Antitrust Division of the U.S. Justice department withdrew its recent report setting standards for the prosecution of monopolization offenses. The report was controversial from the sta... [from E-Commerce Times]
LinContEx.com was going to be “BlogRush done right”…
May 26@9:07pm: A little over a year and a half ago, when John Reese announced his BlogRush service, I thought “oh, c**p,” (that word isn’t “CaRP” :-) “one of the big boys beat me to my idea.” At the time, I’d begun working on a site that was going to be similar,... [from Alpha Gecko : Web Design]
CaRP/WP for WordPress Adds RSS Widget Support
Oct 3@3:42pm: I just uploaded version 2.0 of CaRP/WP (an RSS plugin for WordPress) to my server. CaRP/WP works with CaRP to display RSS feed content, including Amazon.com affiliate feeds and YouTube videos, in the posts and pages of WordPress blogs. This versio... [from Alpha Gecko : Atom/RSS]
My Uber-Optimized Domain And Blog Names
Jul 23@2:15pm: Yesterday I started a new blog on a domain I’d been using mostly to redirect traffic to other sites. The domain name is “ToSeeMore.info”. The blog directory is “about”. It’s on a subdomain named “click”. So the URLs to the blog posts and categorie... [from Alpha Gecko : Web Design]

Telnet Videos on YouTube

Usage Examples:


Basic usage
NOTE: With PHP Telnet versions before 1.1, the following code will not display error messages for certain types of connection failures. If you are using an older version, either upgrade to the current version or use the next code example.

<?php
require_once "PHPTelnet.php";

$telnet = new PHPTelnet();

// if the first argument to Connect is blank,
// PHPTelnet will connect to the local host via 127.0.0.1
$result = $telnet->Connect('www.somewhere.com','login name','password');

if ($result == 0) {
$telnet->DoCommand('enter command here', $result);
// NOTE: $result may contain newlines
echo $result;
$telnet->DoCommand('another command', $result);
echo $result;
// say Disconnect(0); to break the connection without explicitly logging out
$telnet->Disconnect();
}
?>


Display your own error messages
NOTE: With PHP Telnet versions before 1.1, the show_connect_error option was not supported. If you are using an older version, either upgrade to the current version, or delete the line that sets show_connect_error.

<?php
require_once "PHPTelnet.php";

$telnet = new PHPTelnet();
$telnet->show_connect_error=0;

// if the first argument to Connect is blank,
// PHPTelnet will connect to the local host via 127.0.0.1
$result = $telnet->Connect('www.somewhere.com','login name','password');

switch ($result) {
case 0:
$telnet->DoCommand('enter command here', $result);
// NOTE: $result may contain newlines
echo $result;
$telnet->DoCommand('another command', $result);
echo $result;
// say Disconnect(0); to break the connection without explicitly logging out
$telnet->Disconnect();
break;
case 1:
echo '[PHP Telnet] Connect failed: Unable to open network connection';
break;
case 2:
echo '[PHP Telnet] Connect failed: Unknown host';
break;
case 3:
echo '[PHP Telnet] Connect failed: Login failed';
break;
case 4:
echo '[PHP Telnet] Connect failed: Your PHP version does not support PHP Telnet';
break;
}
?>