PHP 8.5.0 Beta 1 available for testing

Voting

: four plus zero?
(Example: nine)

The Note You're Voting On

gratcypalma at gmail dot com
14 years ago
<?php
/*
this script i used for remote my PvPGN Server, to check email user.
not good, but it work.
*/

set_time_limit(0);
$host = 'host';
$port = 'port';
$user = 'user';
$pass = 'pass';
$socket = fsockopen($host, $port) or die('Could not connect to: '.$host);
$userdota = "palma";
if(
$socket)
{
sendcmd("\r",$socket);
$status = "open"; // set status open

while($status=="open") //while we are connected to the server
{
$line = @fgets($socket, 1024) ;
/////////////login////////////////
if (strstr($line, "there is no guest account"))
{
sendcmd($user."\r\n",$socket);
sendcmd($pass."\r\n",$socket);
}
//////////////send command ////////////////////
if (strstr($line,"Your unique name: ".$user))
{
sendcmd("/finger ".$userdota."\r\n",$socket);
}

//////////////get email////////////////////
if (strstr($line,"email:")) // if respone server write "email:"
{
$pattern = '/email:(.*) ,/';
preg_match($pattern, $line, $matches);
fclose($socket);
$status="close"; // status close
$matches=str_replace(" ","", $matches);
$matches=str_replace(",is_operator:0,is_admin:0,","", $matches);
$matches=str_replace("email:","", $matches);
print
$matches[0];
$email=$matches[0];
}
if (
strstr($line,"ERROR: Invalid user.")) // if respone server write "ERROR: Invalid user."
{

fclose($socket);
$status="close";
$error ="Invalid User"; // error message
}

////////////login failed //////////////////////////
if (strstr($line, "Login failed")) // if respone server write "Login failed"
{
$error = "Login Failed"; // error message
fclose($socket);
$status="close";
}

flush(); // close

}

}
function
sendcmd($cmd,$socket) // send command function
{
fputs($socket, $cmd, strlen($cmd));
}
?>

<< Back to user notes page

To Top